标题:[求助]为什么编译通不过
取消只看楼主
chenkuanyi
Rank: 1
等 级:新手上路
帖 子:32
专家分:0
注 册:2007-4-21
 问题点数:0 回复次数:0 
[求助]为什么编译通不过

#include <iostream>
#include <fstream>
using namespace std;
void main(void)
{
ifstream infile("myfile.txt",ios::in|ios::nocreate);
if (!infile)
{
cout<<"文件不存了,不能打开的文件:"<<"myfile.txt"<<endl;
exit(1);
}
}
myfile.txt 是存在的

38.cpp(6) : error C2039: “nocreate”: 不是“std::basic_ios<_Elem,_Traits>”的成

with
[
_Elem=char,
_Traits=std::char_traits<char>
]
38.cpp(6) : error C2065: “nocreate”: 未声明的标识符

为什么啊,还要加什么头文件不成!

[此贴子已经被作者于2007-5-4 8:41:02编辑过]

搜索更多相关主题的帖子: ios std txt 编译 
2007-05-04 08:38



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-136816-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.096733 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved