用dev-c++的请指点!!!!!急!!
我是新手,下了个dev-c++用。可无论编译什么都提示错误。下面是essential c++
的一个例子:
#include <iostream.h>
#include <string.h>
using namespace std;
int main()
{
string user_name;
cout << "Please enter your first name: ";
cin >> user_name;
cout << '\n'
<< "Hello, "
<< user_name
<< "...and goodbye!\n";
return 0;
}
我一编译的时候就提示:
In function `int main()':
c:\dev-c_~1\c__wor~1\untitl~1.cpp:7: `string' undeclared (first use this function)
c:\dev-c_~1\c__wor~1\untitl~1.cpp:7: (Each undeclared identifier is reported only once
c:\dev-c_~1\c__wor~1\untitl~1.cpp:7: for each function it appears in.)
c:\dev-c_~1\c__wor~1\untitl~1.cpp:7: parse error before `;'
c:\dev-c_~1\c__wor~1\untitl~1.cpp:9: `user_name' undeclared (first use this function)
是我没设置好还是我下的这个版本不好使啊??
请各位大侠一定告诉我!!!
问题点数:10、回复次数:5Top
1 楼pinel()回复于 2002-02-07 18:10:06 得分 4
#include <iostream>
#include <string>
Top
2 楼pinel()回复于 2002-02-07 18:18:32 得分 4
#include <iostream>
#include <string>Top
3 楼ttzzgg_80713(身无立锥地,常有四海心---老子有条命)回复于 2002-02-07 20:08:49 得分 2
同上Top
4 楼xiaobenzhu()回复于 2002-02-07 21:42:18 得分 0
lippman的书上有“.h”吗?Top
5 楼xjuniper()回复于 2002-02-08 08:02:27 得分 0
小弟是直接用的,新建源文件时dev-c++给的预处理所以就没看。
多谢各位这么给面子,10分太少了,下次多多啊!!
Top




