const char* cmd; cmd="dir C:\\temp"; std::shared_ptr<FILE> pipe(popen(cmd, "r"), pclose); char buffer[128]; std::string result = ""; while (!feof(pipe.get())) { if (fgets(buffer, 128, pipe.get()) != NULL) result += buffer; }
Report message to a moderator