*nod* *nod* Yup yup was mindfull of what forum I was posting in
![](smile.gif)
Thank you for the help
![](smile.gif)
What I came up with...
// *nix things to find user''s home dir.#include <unistd.h> // getuid#include <pwd.h> // getpwent() and struct passwdvoid main(void){ char caBuffer[1024]; // I technically am using a std::string // uid_t should be a uint32 uid_t MyUID = getuid(); passwd * pPW = NULL; while( (pPW = getpwent() ) != NULL) { if ( pPW->pw_uid == MyUID) { break; // Break out of closest do, for, while } } if ( pPW != NULL) { strcpy(caBuffer, pPW->pw_dir); } endpwent(); // close printf("!! %s\n", caBuffer); // "!! /home/feral"}//END
An I liked the simplicity of ''printf("!! %s\n", getenv("HOME") );'' too!