Untitled
unknown
plain_text
3 years ago
728 B
3
Indexable
#include <stdio.h> #include <string> #include <iostream> using namespace std; int main(int argc, char **argv, char **envp) { char line[100]; cin.getline(line, 100, '\n'); string userInput(line); int sum = 0; while (userInput.compare("") != 0) { if (userInput.compare("__all__") != 0) { sum++; cout <<line << "=" << getenv(line) << '\n'; cin.getline(line, 100, '\n'); userInput.assign(line); } else { for (char **env = envp; *env != 0; env++) { char *thisEnv = *env; printf("%s\n", thisEnv); } return 0; } } return sum; }
Editor is loading...