码迷,mamicode.com
首页 >  
搜索关键字:ostream    ( 266个结果
c++ 虚继承
虚继承(个人感觉用到的地方不多,项目中没有用到这个的)最典型的例子就是iostream的继承方式class istream : virtual public ios{...};//此处就是虚继承,指定ios为虚基类class ostream : virtual public ios{...};cla...
分类:编程语言   时间:2014-10-06 21:41:10    阅读次数:134
Seeking in iostreams
Each type of iostream has a concept of where its “next” character will come from (if it’s an istream) or go (if it’s an ostream). In some situations y...
分类:移动开发   时间:2014-09-24 15:17:16    阅读次数:226
c++重载ostream的实现
#include using namespace std; class Point{ public: Point(int _x = 0, int _y = 0, int _z = 0):x(_x), y(_y), z(_z){} Point(){} ~Point(){} friend ostream& operator<<(ostream &os, const Point &pd); ...
分类:编程语言   时间:2014-09-19 04:29:05    阅读次数:183
string类的实现
mystring.h #ifndef _MYSTRING_H_ #define _MYSTRING_H_ #include #include class mystring { friend std::ostream &operator<...
分类:其他好文   时间:2014-09-06 09:49:13    阅读次数:214
可变参数函数模板
16.53 编写你自己版本的print函数,并打印一个、两个及五个实参来测试它,要打印的每个实参都应有不同的类型。#include#includeusing namespace std;template ostream& print(ostream &os,const T &t){ osost...
分类:其他好文   时间:2014-09-02 00:03:23    阅读次数:206
普通(非模板)类的成员模板
16.21 编写你自己的DebugDelete版本。#include#includeusing namespace std;class DebugDelete{public: DebugDelete(ostream &s=cerr):os(s) {} template void ...
分类:其他好文   时间:2014-09-01 12:13:13    阅读次数:216
泛型编程深入探索之一,模版高级特性小结
一些基本的模版特性:非类参数模版模版所声明的参数可以不是类参数,可以声明的非类参数包括整数(double,float不可以),enum,对象引用或指针。通过模版嵌套实现类或非类参数载类方法参数上的重载(调用时实现,不在定义时实现)友元函数模版:直接举例:template friend ostream...
分类:其他好文   时间:2014-08-26 13:34:36    阅读次数:279
C++中初始化和定义对象的语法,带括号与不带括号的区别
小记:运行环境:win xp vs2008#include #include using std::cout;using std::cin;using std::endl;using std::istream;using std::ostream;class y{private: int a;pub...
分类:编程语言   时间:2014-08-25 11:23:24    阅读次数:253
copy函数与ostream_iterator、reverse_iterator
#include #include #include int main(){ using namespace std; int casts[10]={6,7,2,9,4,11,8,7,10,5}; vector dice(10); copy(casts,casts+10,di...
分类:其他好文   时间:2014-08-15 20:57:09    阅读次数:195
266条   上一页 1 ... 22 23 24 25 26 27 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!