这个问题对于我来说,没有办法了,用了两个小时,愣是没有看出问题在那里~?
vc++6.0里,用向导生成一简单控制程序
在stdafx.h 中
#include <iostream.h>
#include <string.h> //我添加上的
//using namespace std;
在应用程序里!
#include "stdafx.h"
int main(int argc, char* argv[])
{
string str;
cin >> str;
cout << str;
return 0;
}
你说有问题没有!?我靠,这么简单,就是通不过!
错误信息如下:
ompiling...
StdAfx.cpp
Compiling...
hello.cpp
E:\db\hello\hello.cpp(7) : error C2065: 'string' : undeclared identifier //string没有定义,这个需要吗!?我不是在stdafx.h中加上了string.h吗!?
E:\db\hello\hello.cpp(7) : error C2146: syntax error : missing ';' before identifier 'str'
E:\db\hello\hello.cpp(7) : error C2065: 'str' : undeclared identifier
Error executing cl.exe.
hello.exe - 3 error(s), 0 warning(s)
我是看不懂了,那个知道的回一下,首先问题简单,我自己BS一下自己,接触vc++6.0只有一天!见笑!