FILE *pin = popen("nmap -p 123 10.0.1.0/24","r"); if ( pin ) { while (!feof(pin)) { const char *line = readLine(pin); printf("%s ", line); } pclose(pin); }