Not sure if you want the contents of the contents of PATH or the current working directory of the user. However, to cover both options ...
PATH is an environment variable, so you can access it with help getenv()in this case getenv("PATH")and is defined in <stdlib.h>.
The current working directory can be obtained using getcwd()and is defined in <unistd.h>.
source
share