August 19th, 2003, 05:56 PM
C ++ Linux system variables
How does one request system varaibles fom linux? Like if I wanted to display the systems hostname or ip address or any other info about the system. Is there a list of the information that you can get from linux in C++.
August 20th, 2003, 01:51 PM
getenv() or similar. It can return a NULL if it doesn't exist.
const char *getSafeEnv(const char *pEnvName)
const char *pccValue = getenv(pEnvName);
return (pccValue ? pccValue : "(null)");