上一页 1 2 3 4 5 6 7 8 9 10 ··· 33 下一页
摘要: 意思是一个类可以作为其他类的成员 而且在构造的时候,先构造类成员,再构造自己 阅读全文
posted @ 2019-09-25 13:45 ChunhaoMo 阅读(821) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2019-09-25 13:25 ChunhaoMo 阅读(134) 评论(0) 推荐(0) 编辑
摘要: C++拷贝构造函数调用时机有3种 1.将一个已经创建的对象来初始化另一个对象 2.值传递的方式给函数传值 3.以值方式返回局部对象 完整代码 1 #include<bits/stdc++.h> 2 using namespace std; 3 4 class stu 5 { 6 public: 7 阅读全文
posted @ 2019-09-25 13:14 ChunhaoMo 阅读(707) 评论(0) 推荐(0) 编辑
摘要: 构造函数分类 按参数分:有参构造无参构造 按类型:普通构造函数和拷贝构造函数 三种调用方法 1.显示法 2.括号法 3.隐氏转换法 1 #include<bits/stdc++.h> 2 using namespace std; 3 4 class stu 5 { 6 public: 7 stu() 阅读全文
posted @ 2019-09-25 12:04 ChunhaoMo 阅读(543) 评论(0) 推荐(0) 编辑
摘要: C++为什么要有构造函数和析构函数? 传送门:https://blog.csdn.net/u013565071/article/details/78267440 先说一下生活中的场景,大家买的各种电子设备,是不是有个叫出厂设置,就是根据需要给这些设备初始化,进行一些设置 比如时间你得是你那个地方的吧 阅读全文
posted @ 2019-09-25 11:34 ChunhaoMo 阅读(482) 评论(0) 推荐(0) 编辑
摘要: https://www.cnblogs.com/iuices/archive/2011/11/04/2236611.html https://blog.csdn.net/qq_23945057/article/details/52541319 https://blog.csdn.net/u01060 阅读全文
posted @ 2019-09-24 14:34 ChunhaoMo 阅读(70) 评论(0) 推荐(0) 编辑
摘要: 有什么用后面再补 阅读全文
posted @ 2019-09-23 20:21 ChunhaoMo 阅读(284) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2019-09-23 20:08 ChunhaoMo 阅读(94) 评论(0) 推荐(0) 编辑
摘要: 有3名老师每名老师带5名学生做毕业设计 初始化信息 阅读全文
posted @ 2019-09-23 17:22 ChunhaoMo 阅读(462) 评论(0) 推荐(0) 编辑
摘要: 1 #include<bits/stdc++.h> 2 using namespace std; 3 4 int main() 5 { 6 //srand((unsigned)time(NULL)); 7 srand(int(time(0))); 8 for(int i = 0;i < 10;i++) 9 { 10 cout << rand() << "\t"; 11 } 12 return 0; 阅读全文
posted @ 2019-09-23 17:03 ChunhaoMo 阅读(403) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 33 下一页