
C++复习笔记
getyou123
这个作者很懒,什么都没留下…
展开
-
C++快速复习1
C++快速复习类的构造函数知识:本文旨在通过快速的罗列自己曾经的C++代码实现,帮助自己快速复习已经掌握的知识:类的构造函数知识:三种构造函数:1.无参数的构造函数;myclass (){} 调用:myclass M;2.有参数的构造函数;myclass(int a,int b){} 调用: myclass M2(1,3);3.拷贝构造函数;myclass (const myclas...转载 2019-03-12 11:50:12 · 268 阅读 · 0 评论 -
C++快速复习2
const修饰成员函数的几种情况:1.const 在函数的最后,表示该成员函数不具有更改对象成员变量的权限;class Stack{public:void Push(int elem);int Pop(void);int GetCount(void) const; // const 成员函数private:int m_num;int m_data[100]; };int S...转载 2019-04-11 21:39:30 · 222 阅读 · 0 评论 -
C++快速复习3
重载operator=:解决疑惑的实验:#include<iostream>using namespace std;class myclass{public: myclass(int a=0, int b=0)//有参构造函数 { this->a = a; this-&g...转载 2019-04-12 21:18:26 · 113 阅读 · 0 评论