New to C++ so please be gentle. I am trying to write a function that runs a command (such as ipconfig) using popen and then saves the output to a string. I can get the command to execute and display the results correctly, however, all attempts to convert psBuffer to a string so I can return the output are failing. A non-printable ascii character is displayed instead. I thought this may be due to not setting the array to be null (blank?) so I have tried that as well but same result. Everything I have read said it is as easy as doing something like std::string str(s) where s is something like char* s, but not sure that is applicable in this case. Any help provided would be much appreciated at this point.