Defines types ifstream and ofstream representing input and output files respectively. ifstream is derived from istream, inheriting all its operations ... ...
分类:
其他好文 时间:
2017-11-03 23:56:47
阅读次数:
234
#include #include #include #include #include using namespace std; void convert(int num,vector &value) { if(num) { value.push_back(num%10); convert(num... ...
分类:
编程语言 时间:
2017-10-28 19:00:45
阅读次数:
232
到目前为止,我们已经使用了 iostream 标准库,它提供了 cin 和 cout 方法分别用于从标准输入读取流和向标准输出写入流。 本教程介绍如何从文件读取流和向文件写入流。这就需要用到 C++ 中另一个标准库 fstream,它定义了三个新的数据类型: 要在 C++ 中进行文件处理,必须在 C ...
分类:
其他好文 时间:
2017-10-27 16:35:25
阅读次数:
239
一、关键点 头文件 fstream 定义了三个类型来支持文件IO:ifstream、ofstream、fstream 其实上面三个类型就是类,这些类为了管理与流关联的文件,而定义了好多相关的操作: 接受一个 iostream 类型引用(或指针)参数的函数,可以用一个对应的fstream(或sstre ...
分类:
其他好文 时间:
2017-10-17 20:08:26
阅读次数:
192
using namespace std; #include<iostream> #include<map> #include<vector> #include<fstream> int abs(int a) { return a > 0 ? a : -a; } map<int, int> a; vo ...
分类:
其他好文 时间:
2017-10-15 23:18:45
阅读次数:
217
eof() 这个东西是返回文件是否达到尾部。 在读取错误的时候才会触发。 这点要小心,如果写在while(eof) 即使到了文件尾部, 但并没有读取错误,很有可能再次进入循环,然后出现读取错误 .get() .getline() 这两个因为重载了,get的种类,比getline多几个 记住一点:啥叫 ...
分类:
其他好文 时间:
2017-10-14 21:20:57
阅读次数:
211
#include <iostream>#include <string>#include <fstream>#include <sstream>#include <vector>#include <cmath>template <typename DataType>double sigmoid(Da ...
分类:
编程语言 时间:
2017-10-07 16:15:49
阅读次数:
266
"Stdent.h"头文件 #ifndef _STUDENT_H_#define _STUDENT_H_#include <iostream>#include <string>#include <fstream>using namespace std; //存放学生基本信息的结构体struct st ...
分类:
其他好文 时间:
2017-10-01 13:36:51
阅读次数:
180
ifstream infile("student.dat"); while((c=infile.get())!=EOF){} //EOF的值是-1 但在 #include<iostream>using namespace std;int main(){ int c; while((c=cin.get ...
分类:
其他好文 时间:
2017-09-30 09:56:25
阅读次数:
125
Nodejs c++ addon 是用c++去编写Nodejs的插件 技术栈: 1、node-gyp 一个用于把c++文件编译成node可执行文件的库 2、v8 google v8引擎 用于处理c++的数据类型和node的数据类型的转换 3、nan 相当于对v8做了一层封装,去处理v8不同版本兼容的 ...
分类:
编程语言 时间:
2017-09-25 17:29:51
阅读次数:
248