摘要: class Demo { public: Demo(){} Demo(string name, int age){ m_strName = name; m_iAge = age; } //构造函数可以重载 private: string m_strName; ... 阅读全文
posted @ 2017-05-07 12:08 james_lee 阅读(497) 评论(0) 推荐(0) 编辑
摘要: int a = 3; int *p = &a; //定义指针p指向变量a *p = 4; //*p代表a的值 int b = 5; p = &b; //p指向变量b *p = 6; //此时*p代表b的值 int c[3] = {2,5,7}; p = c; //此时p是指向数组c的指针,具体指向数组的第一个元素,即(&c[0]/p/c)三种写法等价 int... 阅读全文
posted @ 2017-05-07 00:32 james_lee 阅读(226) 评论(0) 推荐(0) 编辑