When you call the system function() with any parameter it prints text to the console, I wonder if you can get this text into a string variable.
stdlib system() cout
Collapse
X
-
Originally posted by SaileWhen you call the system function() with any parameter it prints text to the console, I wonder if you can get this text into a string variable.
You have to redirect the output of the system call to a file and then read it.
like this
[code=c]
char array[100]="ls > outfile";
system(array);
//open and read the outfile
[/code]
Thanks
RaghuramComment
Comment