In windows systems you can get the address of any "special" folder as a string...
SHGetSpecialFolderPath()
The CSIDL property is described here
You will need a set of windows headers and libs... If you don't have them with your compiler, these come from the Microsoft SDK
Code:
#include <windows.h>
#include <shlobj.h>
#include <stdio.h>
// get folder path
int GetShellFolder(char *pName, int FCode)
{ return SHGetSpecialFolderPath(NULL,pName,FCode,0); }
int main(void)
{ char path[MAX_PATH];
// get "MyDocuments" folder
if (GetShellFolder(path,CSIDL_MYDOCUMENTS))
printf("My Documents are at : %s",path);
else
printf("Well that didn't work");
return 0; }
Please note this is untested code... intended only to give you the general idea how it's done.