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

Popular posts from this blog

qt - switch/case statement in C++ with a QString type -

python - sqlite3.OperationalError: near "REFERENCES": syntax error - foreign key creating -

Python's equivalent for Ruby's define_method? -