
C++ Learning Notes
SunnyHughLee
https://github.com/zesicus
展开
-
C++栈
只能从一端访问的线性群体特点:先进后出原创 2014-07-17 14:36:23 · 486 阅读 · 0 评论 -
C++重载函数
具有相同的函数名,功能相同原创 2014-07-01 15:31:43 · 456 阅读 · 0 评论 -
C++内联函数
声明时用关键字inline。注意:原创 2014-07-01 14:35:09 · 465 阅读 · 0 评论 -
C++构造函数、拷贝构造函数 和 类组合构造函数调用的应用
例:已知坐标的两点求举例。#include#includeclass Point //点{ double x,y;public: Point(double xx,double yy) //构造函数 { x=xx; y=yy; } double GetX(){return x;} //得到点x坐标 double GetY(){re原创 2014-07-02 09:55:35 · 849 阅读 · 0 评论 -
C++友元
· 友元是C++提供的一种破环数据封装和数据隐藏d原创 2014-07-03 10:45:47 · 483 阅读 · 0 评论 -
C++共享数据类型的保护(常类型)
常类型发射点发原创 2014-07-03 14:24:10 · 528 阅读 · 0 评论 -
C++对象数组
二维数组作为对象的应用举例:#includeclass Location{ int x,y;public: Location(); Location(int xx,int yy); ~Location(); void Move(int m,int n); int GetX(){return x;} int GetY(){return y;}};Location::Loc原创 2014-07-06 14:40:05 · 449 阅读 · 0 评论 -
C++动态内存分配
1、动态申请内存操作符newnew 类型名原创 2014-07-07 13:49:54 · 492 阅读 · 0 评论 -
C++指针
几点注意:1、可以声明void类型指针,但不能声明void类型变量。2、原创 2014-07-06 22:00:43 · 479 阅读 · 0 评论 -
C++继承与派生
1、类的继承与派生· 保持已有类特性而构造xin'le原创 2014-07-09 15:04:53 · 529 阅读 · 0 评论 -
C++多态性
· 多态性指发出同样的消息被不同类型的对象接收时导致wan原创 2014-07-10 16:37:38 · 296 阅读 · 0 评论 -
C++类中具有静态数据成员
静态数据变量在类中引用,要在类外进行原创 2014-07-02 11:44:17 · 477 阅读 · 0 评论 -
C++前向引用声明
对于两个需要互相引用的类,原创 2014-07-02 10:01:47 · 618 阅读 · 0 评论 -
C++类模版
用template声明。原创 2014-07-01 16:15:12 · 501 阅读 · 0 评论 -
C++线性链表
链表,不能像数组一样,只要知道下标就能访问,而是,一个个的顺着链子访问。例:单链表的节点类模版(lb1.h)templateclass Node //节点类{ Node*next; public: T data; //构造函数,item是数据区,*ptrnext指向Node节点的指针 Node(const T& item,Node*ptrnext=NULL);原创 2014-07-17 10:06:27 · 642 阅读 · 0 评论 -
C++动态数组
1、动态数组类模版举例:Class Array原创 2014-07-16 13:48:37 · 733 阅读 · 0 评论 -
C++队列
特点:先进先出原创 2014-07-19 10:29:01 · 573 阅读 · 0 评论 -
C++排序
1、插入排序模板:原创 2014-07-19 15:52:41 · 360 阅读 · 0 评论 -
C++输入输出流、文件流(简)
1、输入输出流运算符重载#includeclass coord{public: int x,y; coord(){x=0;y=0;} //默认构造函数 coord(int i,int j){x=i;y=j}//有参数的构造函数}ostream&operator<<(ostream&stream,coord ob){//输出运算符重载 stream<<ob.x<<","<<ob原创 2014-07-21 09:50:12 · 491 阅读 · 0 评论 -
C++变量名命名规则
约定:1原创 2014-07-01 12:24:36 · 450 阅读 · 0 评论 -
C++枚举类型-enum
形式如下:enum 枚举类型名 {变量值列表}原创 2014-07-01 13:05:02 · 565 阅读 · 0 评论 -
C++自定义数据类型
typedef语句typedef double area,vo原创 2014-07-01 12:41:39 · 417 阅读 · 0 评论 -
C++结构体、联合体
形式:st原创 2014-07-01 13:54:54 · 519 阅读 · 0 评论 -
C++递归调用
程序举例:选出在N个人中找出K个人有多少种选择:原创 2014-07-01 14:12:31 · 417 阅读 · 0 评论 -
C++抽象类
带有纯虚函数的类称为抽象类原创 2014-07-11 14:02:47 · 423 阅读 · 0 评论