- 博客(12)
- 收藏
- 关注
原创 c++学习记录_03.07
#include "iostream"#include "stdio.h"#include "stdlib.h"#include "string.h"using namespace std;//构造函数的初始化列表//用以解决一个类定义里面参入了别的类,而别的类设计了构造函数class a{public: a(int a) { cout<&...
2020-03-21 11:43:34 92
原创 c++学习记录_03.05
#include "iostream"#include "stdio.h"#include "stdlib.h"#include "string.h"using namespace std;//浅拷贝的问题和问题解决//深拷贝的应用场景,解决浅拷贝的出现class NAME1{private: int a; char *q;public: NAME1 ...
2020-03-21 11:43:02 80
原创 c++学习记录_03.04
#include "iostream"#include "stdio.h"#include "stdlib.h"#include "string.h"using namespace std;//copy构造函数的调用时机,也就是之前的赋值参数构造函数class TEST{public: TEST() { cout<<"普通的构造函数"...
2020-03-21 11:42:15 76
原创 c++学习记录_03.03
#include "iostream"#include "stdio.h"#include "stdlib.h"#include "string.h"using namespace std;//构造函数调用(有参数构造函数和无参数构造函数)class TEST{public : TEST() { cout<<"调用了无参数构造函数"&l...
2020-03-21 11:41:36 91
原创 c++学习记录_03.02
#include "iostream"#include "stdio.h"#include "stdlib.h"#include "string.h"using namespace std;//构造函数,作用于类的函数,用于对类的成员变量进行初始化//构造函数和析构函数的另一个作用是因为当创建对象数组的时候,系统会自动对数组每个对象进行默认构造函数的执行class TEST{p...
2020-03-21 11:41:02 82
原创 c++学习记录_03.01
#include "iostream"#include "stdio.h"#include "stdlib.h"#include "string.h"using namespace std;//new 和delete的基本语法//和c语言的 malloc free 类似//分配基础类型变量 分配数组变量 分配类对象class C{private:public: C ...
2020-03-21 11:40:09 94
原创 c++学习记录_02.05
学习内容#include <iostream>#include "stdlib.h"#include "stdio.h"using namespace std;//命名空间的学习namespace NAMESPACE { int a=0; namespace TEACHER { int age; } }int m...
2020-03-21 11:37:46 168
原创 c++学习记录_02.04
学习内容类的使用#include "iostream"#include "stdio.h"#include "stdlib.h"#include "TEACHER.h"using namespace std;//类的使用//类作为函数参数的使用,传类 传类的引用,传类的指针//类的封装 成员和方法的封装,成员访问权限的封装//struct在c++中和class实现一样的功能,...
2020-03-21 11:35:31 72
原创 c++学习记录_02.03
学习内容函数重载#include "iostream"#include "stdio.h"#include "stdlib.h"using namespace std;//函数参数相关扩展//对于函数参数的默认值int a(int a,int b,int c=1)//括号内存在的即为默认的参数值,当没有传入参数数据的时候,会写入默认的参数数值{ return 0;}...
2020-03-21 11:31:46 96
原创 c++学习记录_02.02
学习内容普通引用和常引用的区别#include "iostream"#include "stdio.h"#include "stdlib.h"using namespace std;int main(){ //普通引用 int a=0; int &b; b=a; //常引用 int c=0; const int &am...
2020-03-21 11:30:37 63
原创 c++学习记录_02.01
c++第二天学习记录实现内容:指针引用和二级指针#include "iostream"#include "stdio.h"#include "stdlib.h"using namespace std;//指针引用与c的二级指针struct TEACHER{ char name[10]; int age;};int getteacher1(TEACHER **p...
2020-03-20 23:48:58 78
原创 c++学习过程记录_01
第一天进行人生的第一个c++面向对象编程。#include <iostream> //包含c++的头文件库#include "stdlib.h"using namespace std;//使用标准命名空间stdint main1(){ // printf("hello....\n"); cout << "Hello world!" <<...
2020-03-20 23:42:23 98
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人