How can I access the default home directory from a program, so that I can call chdir() on that directory?
Printable View
How can I access the default home directory from a program, so that I can call chdir() on that directory?
> How can I access the default home directory from a program
Which OS and compiler?
Also, do you mean
- the home dir of the person who owns the program
- the home dir of the person running the program
I'm using Cygwin and gcc as my compiler. Basically, I want to use the directory that the terminal starts in whenever a new one is loaded.
Use getenv("HOME")