Hi,
I have a C program that invokes the system function every 1 sec (for sampling reasons) and I need to parse the output as shown in stdout,by storing this output to a char array.What I first imagined to be the solution was:
system("tunnel -L -c"
;
fscanf(stdout,"%s",buffer);
but when control has reached fscanf,the system function has already been completed,having displayed already the output.
How can I possibly capture that output (without re-directing it to a file)?
Thank you,
George
I have a C program that invokes the system function every 1 sec (for sampling reasons) and I need to parse the output as shown in stdout,by storing this output to a char array.What I first imagined to be the solution was:
system("tunnel -L -c"
fscanf(stdout,"%s",buffer);
but when control has reached fscanf,the system function has already been completed,having displayed already the output.
How can I possibly capture that output (without re-directing it to a file)?
Thank you,
George