码迷,mamicode.com
首页 >  
搜索关键字:ofstream    ( 221个结果
【ThinkingInC++】3、文件的拷贝
/** * 功能:文件的拷贝 * 时间:2014年8月8日07:40:21 * 作者:cutter_point */ #include #include #include #include using namespace std; int main() { ifstream fin("test1.jpg", ios::binary); ofstream fout("fuzhi...
分类:编程语言   时间:2014-08-08 09:43:36    阅读次数:263
USACO Section 2.2 Subset Sums
/* ID: lucien23 PROG: subset LANG: C++ */ #include #include using namespace std; int main() { ifstream infile("subset.in"); ofstream outfile("subset.out"); if(!infile || !outfile) { cout << ...
分类:其他好文   时间:2014-08-04 14:35:27    阅读次数:200
USACO Section 2.2 Runaround Numbers
/* ID: lucien23 PROG: runround LANG: C++ */ #include #include #include using namespace std; int main() { ifstream infile("runround.in"); ofstream outfile("runround.out"); if(!infile || !outfil...
分类:其他好文   时间:2014-08-04 14:22:27    阅读次数:173
int 类型的数值一次性写入一次性读取
将一个20M 的int数值一次性保持,并一次性读取,避免保存为char 类型,进行格式转换的时候很耗时。 #include #include #include using namespace std; #define MAXNUM 2560*1920 void savedata(char *filename,int *pdata) { ofstream out; out....
分类:其他好文   时间:2014-07-30 12:24:03    阅读次数:163
USACO Section 2.1 Hamming Codes
/* ID: lucien23 PROG: hamming LANG: C++ */ #include #include #include using namespace std; int main() { ifstream infile("hamming.in"); ofstream outfile("hamming.out"); if(!infile || !outfile) ...
分类:其他好文   时间:2014-07-29 14:54:58    阅读次数:169
USACO Section 2.2 Preface Numbering
/* ID: lucien23 PROG: preface LANG: C++ */ #include #include #include #include using namespace std; int main() { ifstream infile("preface.in"); ofstream outfile("preface.out"); if(!infile || ...
分类:其他好文   时间:2014-07-29 14:54:28    阅读次数:177
《C++ Primer Plus》学习笔记11
《C++ Primer Plus》学习笔记11 第17章 输入、输出和文件 主要内容: 1)C++角度的输入和输出 2)iostream类系列 3)重定向 4)ostream类方法 5)格式化输出 6)istream类方法 7)流状态 8)文件I/O 9)使用ifstream类从文件输入 10)使用ofstream类输出到文件 11)使用fstream类进行文件输...
分类:编程语言   时间:2014-07-25 11:25:31    阅读次数:318
C++输出数据到txt
平时总遇到将数据写到txt中的情况,尤其是在调试程序看中间结果时,所以将代码保存下来,方便以后应用: ofstream outfile; string InitialFileName("Initial.txt"); string NewFileName("New.txt"); outfile.open(InitialFileName, ostream::app); /*...
分类:编程语言   时间:2014-07-16 10:46:58    阅读次数:193
文件处理
#include "my_file.h" //将文件内容拷贝到指定文件 int mycopy(const char *filename) {  ifstream infile(filename, ios::binary);  ofstream outfile("TRACE.txt", ios::binary);    if (!infile.is_open() || !outfile...
分类:其他好文   时间:2014-06-28 08:46:56    阅读次数:199
c++文件读写相关
在看C++编程思想中,每个练习基本都是使用ofstream,ifstream,fstream,以前粗略知道其用法和含义,在看了几位大牛的博文后,进行整理和总结:这里主要是讨论fstream的内容:[java]view plaincopyprint?#includeofstream//文件写操作内存写...
分类:编程语言   时间:2014-06-27 00:30:11    阅读次数:378
221条   上一页 1 ... 19 20 21 22 23 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!