![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
从0到1
TurnaroundBin
Don't care about anything,Let's work together!
展开
-
从0到1
从0到1,回归基础,夯实基础 点滴积累,成就未来原创 2017-08-17 21:54:29 · 242 阅读 · 0 评论 -
指向对象成员的指针
#include <iostream>#include <string>using namespace std;class Student{public: Student(int n, string nam, char s) { num = n; name = nam; sex = s; cout << "Con原创 2017-09-01 17:39:54 · 274 阅读 · 0 评论 -
继承与多态
#include <iostream>using namespace std;//声明类Pointclass Point{public: Point(float x = 0, float y = 0); //构造函数 void setPoint(float, float);//设置x\y坐标值 float getX() const { return x; }//getX原创 2017-09-10 22:29:26 · 176 阅读 · 0 评论 -
const用法总结
const修饰的常成员函数可以理解为是一个“只读”函数。 如果一定要修改常对象中的每个数据成员的值,对该数据成员函数声明为mutable,如: mutable int count;把count声明为可变数据成员,即可改变。const修饰指针情况1:const位于*号左边,const修饰指针所指向的变量,即指针指向为常量,可以先不进行初始化;int b = 500;const int *a原创 2017-09-01 10:32:44 · 215 阅读 · 0 评论 -
继承和派生--包含子对象的子类的构造函数
#include <iostream>#include <string>using namespace std;//包含子对象的子类的构造函数class Student //父类{public: Student(int n, string nae) :num(n), name(nae){} //父类构造函数 //Stude原创 2017-09-06 23:25:40 · 398 阅读 · 0 评论 -
C++软件开发经典面试题目
1、 Static有什么用途?(1)函数体内static变量的作用范围是该函数体,该变量的内存只被分配一次,因此它的值在下次调用时不变; (2)模块内的static全局变量同样只能在该模块内的函数访问和调用,不能被模块外的其他函数访问; (3)在类中的static成员变量属于整个类所有,对类的所有对象只有一份拷贝,这个函数不接受this指针,因为只能范围类的static成员函数。2、 c原创 2017-09-01 10:43:05 · 12131 阅读 · 2 评论 -
类声明和成员函数定义分离
- 列表内容分离过程如下:原创 2017-08-29 09:40:35 · 912 阅读 · 0 评论 -
构造函数
构造函数原创 2017-08-29 09:38:12 · 179 阅读 · 0 评论 -
结构体
结构体原创 2017-08-23 20:53:05 · 180 阅读 · 0 评论 -
重载流插入/流提取运算符
#include <iostream>using namespace std;//重载流插入/流提取运算符class Complex{public: friend ostream& operator <<(ostream&, Complex&); friend istream& operator >> (istream&, Complex&);private: dou原创 2017-09-05 17:18:56 · 421 阅读 · 0 评论 -
重载双目/单目运算符
#include <iostream>using namespace std;//重载双目运算符 > < ==class String{public: String(){ p = NULL; }//默认构造函数 String(char *str);//构造函数 friend bool operator > (String &string1, String &strin原创 2017-09-05 16:57:48 · 392 阅读 · 0 评论 -
指针
从0到1,回归基础,夯实基础 ,点滴积累,成就未来指针数组,函数指针,多重指针,动态分配内存原创 2017-08-23 16:28:45 · 263 阅读 · 0 评论 -
链表\共用体
共用体\链表原创 2017-08-24 20:25:45 · 278 阅读 · 0 评论 -
指针和数组
指针 数组原创 2017-08-19 22:04:11 · 115 阅读 · 0 评论 -
static静态局部变量
#include <stdio.h>#include <stdlib.h>//静态局部变量staticint f(int a){ int b = 0;//等价auto int b = 0; static int c = 3; b = b + 1;//b调用结束后,释放,再次调用时还是0+1 c = c + 1;//c是static局部变量,调用结束后并不释放,原创 2017-08-19 22:06:11 · 206 阅读 · 0 评论 -
extern 的用法
从0到1,回归基础,夯实基础 点滴积累,成就未来 *extern 的用法:原创 2017-08-18 15:46:49 · 572 阅读 · 0 评论 -
运算符重载
运算符重载规则: 1)只能对已有的C++运算符进行重载; 2)不能重载的运算符只有5个,分别是: . //成员访问运算符.* //成员指针访问运算符:: //域运算符sizeof //长度运算符?: //条件运算符3)重载不能改变运算符运算对象个数; 4)不能改变运算符的优先级别; 5)不能改变运算符的结合性,如”=”是自右至左,重载后依然; 6)原创 2017-09-05 11:58:35 · 272 阅读 · 0 评论