C++随心笔记
文章平均质量分 65
creator平
期望破茧成蝶时的飞翔,向往突破蝉蛹后的鸣叫。
展开
-
随笔——继承与派生
//继承与派生的概念#include<iostream>using namespace std;class node//基类{private: string name;//名字 int garde;//分数public: void out() { cout<<"name:"<<name<<e...原创 2018-06-03 14:09:29 · 95 阅读 · 0 评论 -
随笔——多态与虚函数
//多态与虚函数#include<iostream>using namespace std;class A{ public: virtual void print() { cout<<"A"<<endl; }};class B:public A{ public: virtual voi...原创 2018-06-04 21:14:46 · 155 阅读 · 0 评论 -
随笔——重载函数+构造函数+析构函数
//构造函数&&重载函数#include<iostream>using namespace std;class node{private: int x,y;public: node()//默认构造函数 { x=0; y=0; } node(int a);//构造函数重载 node...原创 2018-05-30 17:38:23 · 770 阅读 · 0 评论 -
随笔——对象进阶
//常量对象和常成员函数#include<iostream>using namespace std;class node{public: node(){}; F()const//常成员函数 { cout<<"********"<<endl; } P() { cout<...原创 2018-05-31 14:18:21 · 140 阅读 · 0 评论 -
随笔——运算符重载
//+,-,运算符重载#include<iostream>using namespace std;class node{private: int x,y;public: node(){}; node(int a,int b) { x=a,y=b; } init() { cin>&g...原创 2018-05-31 20:03:58 · 157 阅读 · 0 评论