Capturing stdout from a system() command optimally [duplicate]

From the popen manual:

#include <stdio.h>

FILE *popen(const char *command, const char *type);

int pclose(FILE *stream);

Leave a Comment