I am using MS Visual Studio 2008 for developing a C++ application. I use the 'getenv()' function to fetch an environment variable, but when the searched environment variable doesn't exist, it throws an access violation exception. What is the issue here and how to correct it?
The docs say that the getenv() function will return a NULL pointer if the searched environment variable doesn't exist, but why am I getting this access violation exception?