I just figured it out.
For anyone who may run into this in the future, I used the following include statement:
#include <cstdlib>
and used the following statement to retrieve the environment variable:
char* user = getenv("username");
Okay, Thanks. But is there a way I can access that environment variable inside from inside a C++ program?
Also, is it possible to read data from a cookie file from inside a program? That's actually what I'm trying to do. The problem is that the cookie files are in Documents and...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.