#include #include //for getenv #include //for strcmp using namespace std; int main(int argc, char *argv[], char *envp[]) { //Output all the environment variables. for (int i {0}; envp[i] != nullptr; ++i) { cout << envp[i] << "\n"; } //Output one environment variable. const char *const p {getenv("USER")}; if (p != nullptr) { cout << "\n"; cout << p << "\n"; } if (strcmp(p, "mmeretzky") != 0) { //if the USER is not mmeretzky cerr << "Sorry, only mmeretzky can run this program.\n"; return EXIT_FAILURE; } return EXIT_SUCCESS; }