为什么编译总是说:fatal error?
我抄的c++ primer上的一个范例:
//instr3.cpp--reading more than one word with get()&get()
#include<iostream>
using namespace std;
int main()
{
const int ArSize=20;
char name[ArSize];
char dessert[ArSize];
cout<<"Enter your name: "<<endl;
cin.get(name,ArSize).get(); //read string ,newline
cout<<"Enter your favorite dessert: "<<endl;
cin.get(dessert,ArSize).get();
cout<<"I have some delicious "<<dessert;
cout<<" for you, "<<name<<"."<<endl;
return 0;
}
可是总是提示我可恶的:
--------------------Configuration: hzh_5 - Win32 Debug--------------------
Compiling...
hzh_5.cpp
fatal error C1083: Cannot open compiler generated file: 'Debug/hzh_5.obj': Permission denied//这里,这里,气死我了!
Error executing cl.exe.
hzh_5.exe - 1 error(s), 0 warning(s)
是我的vc有问题了么?
问题点数:10、回复次数:6Top
1 楼whoke(hy)回复于 2002-11-08 22:03:25 得分 0
cin.get(name,ArSize).get()是什么意思啊?我不会用iostreamTop
2 楼artman(The Final.)回复于 2002-11-08 22:13:23 得分 6
vc 不能写入或改写debug/hzh_5.obj。自己看看什么问题或把hzh_5.obj删除Top
3 楼shf13()回复于 2002-11-08 22:17:41 得分 0
你可能同时打开了两个工作区,关掉一个试试Top
4 楼rivershan(阿门)回复于 2002-11-08 22:19:19 得分 0
没毛病啊~
VC6~Top
5 楼smallfox(小狐狸)回复于 2002-11-08 22:21:55 得分 4
a suggestion from my heart:
use plain compiler, don't use VC such "powerful" one when you first learn a new language like C++
:)Top
6 楼hzh_shat(水)回复于 2002-11-08 22:45:42 得分 0
我嫌麻烦,每次写很多范例都用一个工作区,每次都重构全部文件,以前的时候这样做没有问题,渐渐的,有时候编译一次出现这样的提示,然后再编译一次,救通过了,可是现在根本就是编译N次也通不过了(很确定),我只好换了一个新的工作区,就没有问题了,这是什么的问题呢?
To:artman 嗯,你说的很是一个办法,可是为什么会不能改写呢?
To:smallfox 嗯,可是我已经用了,而且以后还打算继续学vc特想熟悉到底有什么不同,所以就么继续用下去了,呵呵,不过,谢谢
to: whoke cin.get()是istream类中的对象cin的一个成员函数,呵呵
Top
相关问题
- 编译出错,fatal error C1010: 请指教!
- 关于预编译,fatal error C1010
- 编译时报Linker Fatal Error错:
- 编译错误:[Linker fatal Error]fatal:Expected a file name:
- 编译时错误提示:[link fatal error]Fatal:expected a file name
- 编译错误:fatal error C1010: unexpected end of file while looking for precompiled header directive
- 怎么处理stdafx.h的预编译错误,fatal error C1010????
- 编译时提示:fatal error C1083: Cannot open precompiled header file
- 编译微软的Detours 1.5时老是出错:fatal error LNK1103
- 编译时出现:[Linker Error]:Fatal:Access violation.Link terminated.怎么办?




