I am using gcc for windows. The OS is windows XP. How do I import the homepath variable into my c program so I can write to c:\%homepath%\desktop? I would like to use something similar to:
fd = fopen('C:\\%%homepath%%\\desktop\\helloworld.txt','w');
Use getenv() to get the value of an environment variable, then use sprintf or strcat to compose the path.