c - system() output to a char* -


  int system (const char *)   

How can I send output I can order this command (say that the command is "pwd") in four * Its return is an integer but I want the result of the command to be sent in four *.

You can use the command "pwd" in the form of "tempfile" directly to the output of the command pipe Can do.
Another method is to use popen

 FILE * output = popen ("PWD", "R");  

This will give you a file indicator where you can read the output.

Comments