title: Get home directory in Linux
body: <p>I need a way to get user home directory in C++ program running on Linux. If the same code works on Unix, it would be nice. I don't want to use HOME environment value.</p>
  
  <p>AFAIK, root home directory is /root. Is it OK to create some files/folders in this directory, in the case my program is running by root user?</p>