Ray's playground

 

2011年4月3日

char array

摘要: 1#include<iostream>2#include<vector>3#include<string>4usingnamespacestd;56intmain()7{8constchar*p="hello";9intcount=0;10while(*p)11{12cout<<*p<<endl;13count++;14p++;15}1617constcharca[]={'h','e','l','l','o'};18constchar* 阅读全文

posted @ 2011-04-03 11:18 Ray Z 阅读(444) 评论(0) 推荐(0) 编辑

Item 37: Never redefine a function's inherited default parameter value(Effective C++)

摘要: Never redefine an inherited default parameter value, because default parameter values are statically bound, while virtual functions — the only functions you should be overriding — are dynamically bound.1#include<iostream>2#include<string>3usingnamespacestd;45classShape6{7public:8virtualv 阅读全文

posted @ 2011-04-03 11:09 Ray Z 阅读(303) 评论(0) 推荐(0) 编辑

Item 36: Never redefine an inherited non-virtual function(Effective C++)

摘要: Never redefine an inherited non-virtual function. 阅读全文

posted @ 2011-04-03 10:51 Ray Z 阅读(103) 评论(0) 推荐(0) 编辑

导航