首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

高手看看这段小程序的异常.

2012-02-28 
高手看看这段小程序的错误....#includeiostream#includefstreamusingnamespacestdintmain(){ofstream

高手看看这段小程序的错误....
#include   <iostream>  
#include   <fstream>
using   namespace   std;
int   main()
{
        ofstream   myfile( "c:\\1.txt ",ios::out|ios::trunc,0);
        myfile < < "中国软件开发实验室 " < <endl < < "网址: " < < "www.cndev-lab.com ";  
        myfile.close();
        system( "pause ");
        return   0;
}
CSDN   一BLOG上拷的,编译出错,不知道是什么错误

error   C2661:   'basic_ofstream <char,struct   std::char_traits <char>   > ::basic_ofstream <char,struct   std::char_traits <char>   > '   :   no   overloaded   function   takes   3   parameters

没这个重载函数么??   该怎么改???我有1.TXT这个文件啊



[解决办法]
ofstream myfile( "c:\\1.txt ",ios::out|ios::trunc);
[解决办法]
那是unix/linux下才有的东西。

热点排行