重新编码模仿

时间:2011-04-04 01:27:50

标签: c++ server-side

有人可以模仿这段代码,或者帮我做。它用于服务器端文件,但它需要使用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;
}

1 个答案:

答案 0 :(得分:0)

C ++本质上是C的超集,所以这已经是有效的C ++代码,应该可以正常编译。