我不确定这到底有什么问题...它不会为我编译,我将它从 c 翻译成 C++(或尝试)...是的,我是初学者。谢谢!
#include <stdlib.h>
#include <stdio.h>
using namespace std;
int main( int argc, char * argv[], char* env[]) {
int i = 0;
cout << "Content-type: text/plain\n\n";
/* print query string only */
cout << "%s\n",getenv("QUERY_STRING");
/* print the while environment */
while (env[i]) cout << "%s\n",env[i++];
return 0;
}
最佳答案
改变这些:
cout << "%s\n",getenv("QUERY_STRING");
进入这个:
cout << getenv("QUERY_STRING") << endl;
另一个也一样,(编辑:)像这样:
while (env[i]) cout << env[i++] << endl;
关于c++ - 编译麻烦c转c++反,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5533906/