using namespace std;
-const string ENV[24] = {
- "COMSPEC", "DOCUMENT_ROOT", "GATEWAY_INTERFACE",
- "HTTP_ACCEPT", "HTTP_ACCEPT_ENCODING",
- "HTTP_ACCEPT_LANGUAGE", "HTTP_CONNECTION",
- "HTTP_HOST", "HTTP_USER_AGENT", "PATH",
- "QUERY_STRING", "REMOTE_ADDR", "REMOTE_PORT",
- "REQUEST_METHOD", "REQUEST_URI", "SCRIPT_FILENAME",
- "SCRIPT_NAME", "SERVER_ADDR", "SERVER_ADMIN",
- "SERVER_NAME", "SERVER_PORT", "SERVER_PROTOCOL",
- "SERVER_SIGNATURE", "SERVER_SOFTWARE"};
-
-int main(int av, char **ac)
+int main(int av, char **ac, char **envp)
{
(void)av;
cout << "\n";
@@ -29,7 +18,13 @@ int main(int av, char **ac)
{
cout << "" << "Argumento de entrada N." << i << "= " << ac[i] << " |
\n";
}
-
+ cout << "" << "Variables de entorno" << " |
\n";
+ int i = 0;
+ while(envp[i] != NULL)
+ {
+ cout << "" << "N." << i << "= " << envp[i] << " |
\n";
+ i++;
+ }
cout << "<\n";
cout << "\n";
cout << "