So I try
char buffer[1000];
GetEnvironmentVariable("PATH",(char*)&buffer,sizeof(buffer));
std::cout << buffer << std::endl;
to check if it exists but I do not see how to see if its empty? And It couts some really bad output=(
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
MSDN has this to say about
GetEnvironmentVariable:(Source: http://msdn.microsoft.com/en-us/library/ms683188.aspx)
So I guess you should test the function’s return value: