I am trying to run a Linux ps command from C++.
I can do a system("ps") and it will execute the command, but I need to capture the output and store it in a string. I tried the obvious set a character array equal to the system("ps") but the string had only a null in it. Do I need to do a redirect? If so, I'm not very good with those, how do I do that?
Thanks for the help!