24小时热门版块排行榜    

查看: 454  |  回复: 9
当前主题已经存档。
当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖

steincat

荣誉版主 (知名作家)

天啊,小木虫

[交流] [问题解决,感谢killl]请教C++文件输出自动命名问题

#include
#include
#include

void main()
{
        ofstream outfile;

        outfile.open("filename_0.dat",ios:ut);
        if(!outfile)
        {       
                cerr<<"File could not be open."<                 abort();
        }
        outfile<<"Hi, I'am Microsoft Visual C++, how are you?"<         outfile.close();
}

上述文件名filename_0中的数字0表示时间,计算中不断变化,因此想让程序自换成其他数字,例如100,200,300,400......等,请问如何实现?

[ Last edited by steincat on 2006-6-28 at 19:31 ]
Lifeisdifficult.
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

maximus

铜虫 (小有名气)

小木虫真是棒!!!
10楼2006-06-28 21:25:27
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 steincat 的主题更新
普通表情 高级回复(可上传附件)
信息提示
请填处理意见