Lets say I'm using a command such as system("ipconfig") on a windows machine, how might I go about taking the information given from using ipconfig and storing it in a text file? Is this even possible?
A really simple way to avoid all that grief is to simply use system() with a redirection in the shell command:
1 2 3 4 5 6 7 8 9 10
// Execute the "ipconfig" process and save the results in "out.txt".
system( "ipconfig > ipf.txt" );
// Now open the file and read the results
ifstream ipf( "ipf.txt" );
...
ipf.close();
// Don't forget to delete the file now that you are done with it
remove( "ipf.txt" );