有人可以模仿这段代码,或者帮我做。它用于服务器端文件,但它需要使用C ++,而我根本不熟悉C ++。提前感谢您的任何帮助!
#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;
}
答案 0 :(得分:0)
C ++本质上是C的超集,所以这已经是有效的C ++代码,应该可以正常编译。