c - unix command result to a variable - char* -


How can I specify "PWD" (or any other command in that case) as a result (current working Dior) Four in a variable?

Anything can be done not just surrounded by "PWD".

Thank you.

get started popen . This allows you to run a command with your standard output directed to a FILE * , which your parents can read.

As with fgets , getchar , etc.), however, you want to avoid running an external program for it - you should be available, which results in more direct results Will give.

Comments