| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 959 人关注过本帖
标题:请问此问题为什么无法编译?
取消只看楼主 加入收藏
biancku
Rank: 2
等 级:论坛游民
帖 子:41
专家分:19
注 册:2010-11-30
结帖率:64.71%
收藏
已结贴  问题点数:5 回复次数:0 
请问此问题为什么无法编译?
#include<fstream>
#include<iostream>
using namespace std;
int main()
{
    ifstream infile("f1.dat",ios::in|ios::noreplace);
    if(!infile)
    {
        cerr<<"open error.\n";
        exit (1);
    }
    cerr<<"计算机\n";
    return 0;
}
编译结果:
--------------------Configuration: w - Win32 Debug--------------------
Compiling...
1.cpp
E:\程序A\w\1.cpp(6) : error C2039: 'noreplace' : is not a member of 'basic_ios<char,struct std::char_traits<char> >'
E:\程序A\w\1.cpp(6) : error C2065: 'noreplace' : undeclared identifier
Error executing cl.exe.

1.obj - 2 error(s), 0 warning(s)
搜索更多相关主题的帖子: 计算机 open 
2011-02-23 13:41
快速回复:请问此问题为什么无法编译?
数据加载中...
 
   



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

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