Basic and Advance C Question:

Download Job Interview Questions and Answers PDF

fopen isnt letting me open files like "$HOME/.profile" and "~/.myrcfile".

C Programming Interview Question
C Programming Interview Question

Answer:

fopen isn't letting me open files like "$HOME/.profile" and "~/.myrcfile".

Under Unix, at least, environment variables like $HOME, along with the home-directory notation involving the ~ character, are expanded by the shell, and there's no mechanism to perform these expansions automatically when you call fopen.

Download C Programming Interview Questions And Answers PDF

Previous QuestionNext Question
How can I increase the allowable number of simultaneously open files?Why cant I open a file by its explicit path?