n00b回来了...帮助outpout to file ... [英] The n00b is back...help with outpout to file...

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

问题描述

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

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

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

解决方案

Ha ****** *@gmail.com 写道:


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

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

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



了解如何使用编辑器?


-

Ian Collins。


2月28日晚上8:42,HardHa ... @ gmail.com写道:


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

的东西放入其中时,它就会删除旧的东西,有没有办法解决这个问题?所以它不会抹掉最后的东西吗?



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




2月28日晚上8:43,Ian Collins< ian-n ... @ hotmail.comwrote:


HardHa ... @ gmail.com写道:


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

的东西放入其中时,它就会删除旧的东西,有没有办法解决这个问题?所以它不会抹掉最后的东西吗?



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


-

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?

解决方案

Ha*******@gmail.com wrote:

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.


On Feb 28, 8:42 pm, HardHa...@gmail.com wrote:

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?

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


On Feb 28, 8:43 pm, Ian Collins <ian-n...@hotmail.comwrote:

HardHa...@gmail.com wrote:

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.

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 ...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆