what is stdoutread in c++
#include <iostream>
#include <cstdio>
#include <cstring>
int main() {
FILE* pipe = popen("ls", "r");
if (!pipe) return 1;
char buffer[128];
std::string result = "";
while (!feof(pipe)) {
if (fgets(buffer, 128, pipe) != NULL)
result += buffer;
}
pclose(pipe);
std::cout << result.c_str();
return 0;
}