![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
c++基础
xs1243
这个作者很懒,什么都没留下…
展开
-
notes of Effective C++
不过是看Effective C++看到我之前没有注意到的地方。原创 2016-07-30 18:22:27 · 236 阅读 · 0 评论 -
copy constructor, assignment, global
#include#includeusing namespace std;class CObj{private: string a;public: CObj(string aa): a(aa) { cout<<"Constructor for "<<aa<<endl; } CObj(const CObj& cobj) {原创 2016-10-21 22:48:57 · 170 阅读 · 0 评论 -
指针数组和数组指针
指针数组:array of pointers, 数组中的元素都是指针,例如 char *p[10];数组指针:a pointer to an array, 一个指向数组的指针,例如 char (*p)[10];#include#includeusing namespace std;int main(){ char *p[10]; cout<<sizeof(p)原创 2016-10-22 18:28:55 · 140 阅读 · 0 评论 -
虚函数,构造函数,析构函数调用
#includeusing namespace std;class CObj{public: CObj() { cout<<"CObj::CObj()"<<endl; } virtual ~CObj() { cout<<"CObj::~CObj()"<<endl; } virtual void virf原创 2016-10-21 22:18:12 · 212 阅读 · 0 评论 -
sizeof的用法,边界对齐,指针参数传递,union
#includeusing namespace std;//最大元素长度union A{ char a; int b; double c; double d;};struct B{ char a; char d; double b; char c;};struct C{ char a; char d;原创 2016-10-21 21:41:25 · 290 阅读 · 0 评论