LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   opening file in home dir with C++ (http://www.linuxquestions.org/questions/programming-9/opening-file-in-home-dir-with-c-201370/)

qcoder 07-05-2004 12:01 PM

opening file in home dir with C++
 
I am writing a program and I want it to be able to open a file from the users home directory. if the program is in /bin or somewhere how would I do that?
I have tried somthing like ofstream(~/thefile); but that doesn't seem to work.

ToniT 07-05-2004 12:19 PM

~ is just a shell completititon variable that sh uses.

see "man getenv"


All times are GMT -5. The time now is 07:04 PM.