本文介绍了n00b回来了...帮助outpout to file ...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿,我在编辑文件时遇到一些问题。每当我把

的东西放进去的时候,它就会删除旧的东西,有没有办法解决这个问题

所以它不会抹掉最后的东西?

解决方案



了解如何使用编辑器?


-

Ian Collins。




很抱歉双重帖子,但除了cplusplus.com上的那个之外,有没有人有任何好的C ++教程






了解如何使用你的编辑器?


-

Ian Collins。



o.0


不,像这样:


//基本文件操作

#include< iostream>

#include< fstream>

使用命名空间std;


int main(){

ofstream myfile;

myfile.open(" example.txt");

myfile << 将其写入文件。\ n;;

myfile.close();

返回0;

}


Hey, I''m having a little problem editing a file. Whenever I put
something into it, it erases the old thing, is there a way to fix this
so it doesn''t erase the last thing?

解决方案

Learn how to use your editor?

--
Ian Collins.


Sorry for double post, but does anyone have any good C++ tutorials
besides the one at cplusplus.com?



Learn how to use your editor?

--
Ian Collins.

o.0

No, like this:

// basic file operations
#include <iostream>
#include <fstream>
using namespace std;

int main () {
ofstream myfile;
myfile.open ("example.txt");
myfile << "Writing this to a file.\n";
myfile.close();
return 0;
}


这篇关于n00b回来了...帮助outpout to file ...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-27 01:22