Can someone imitate this code, or help me do it. Its for a server side file, but it needs to be in C++ and I am not familiar with C++ at all. Thanks in advance for any assistance!
#include <stdlib.h>
#include <stdio.h>
int main( int argc, char * argv[], char* env[]) {
int i = 0;
printf("Content-type: text/plain\n\n");
/* print query string only */
printf("%s\n",getenv("QUERY_STRING"));
/* print the whole environment */
while (env[i]) printf("%s\n",env[i++]);
return 0;
}
C++ is essentially a superset of C, so this is already valid C++ code and should compile fine as such.