上一页 1 2 3 4 5 6 7 8 9 10 ··· 73 下一页
摘要: https://blog.csdn.net/Flying_sfeng/article/details/87453629 阅读全文
posted @ 2021-12-25 16:37 邱明成 阅读(17) 评论(0) 推荐(0) 编辑
摘要: https://v.qq.com/x/page/l0510c8ay4z.html 阅读全文
posted @ 2021-11-23 12:43 邱明成 阅读(35) 评论(0) 推荐(0) 编辑
摘要: 1. 安装gtest 2. 测试demo 文件名:13_gtest.cpp #include <iostream> #include "gtest/gtest.h" using namespace std; int sum(int a, int b) { return a + b; } TEST(M 阅读全文
posted @ 2021-11-10 01:24 邱明成 阅读(1335) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <string> using namespace std; class P { public: int id; string name; public: P() { cout << "wu can p gou zao " << endl; } 阅读全文
posted @ 2021-11-08 08:54 邱明成 阅读(116) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <string> using namespace std; class P { public: int id; string name; public: P() { cout << "wu can p gou zao " << endl; } 阅读全文
posted @ 2021-11-08 08:48 邱明成 阅读(162) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <string> using namespace std; class Person { public: int id2 = 202; int id1 = 201; public: Person() = default; // 当使用常量进行 阅读全文
posted @ 2021-11-07 22:37 邱明成 阅读(185) 评论(0) 推荐(0) 编辑
摘要: 默认构造函数以下两种写法是等价的// Person(){}Person() = default; // 显示禁用系统为我们自动生成默认构造函数Person() = delete; 阅读全文
posted @ 2021-11-07 22:12 邱明成 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 1. 类的静态非常量成员不能在声明的时候进行初始化2. 类的静态成员(属性与函数)在定义的时候不能加static(声明和定义分开时)3. 普通成员属性默认初始值是不确定的,静态成员属性的默认初始值是会给定相应类型的0值5. 普通常量成员属性除了在声明的时候给定初始值外,还可以在构造函数的初始化列表给 阅读全文
posted @ 2021-11-07 22:10 邱明成 阅读(160) 评论(0) 推荐(0) 编辑
摘要: 代码1: #include <iostream> using namespace std; class Person { public: int id = 200; //如果这里没有代码id(1000),定义出来的对象的id值为int id = 200;代码初始的值 Person() : id(10 阅读全文
posted @ 2021-11-07 16:15 邱明成 阅读(100) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> using namespace std; class Person { public: int id = 200; string name = "qiumc"; // 在类中声明并定义静态常量字符串数组 // char*改为string类型会报错 // 没有c 阅读全文
posted @ 2021-11-07 15:36 邱明成 阅读(1465) 评论(0) 推荐(1) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 73 下一页