This is somewhat related to this, as I decided, after considering grumpy's reply, to write the log file to the home directory.
That raised another question, and it felt like it deserves a post of its own (I hope I'm not wrong).
So I want to obtain the user's home directory.
I know it can be done with getenv("HOME"), but if I'll inspect the value of the enviroment variable HOME, it might work when I run it now, but it won't work on Windows, since windows uses HOMEPATH to save the user's home directory.
Is there a different, more cross-platform way to do it?