上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 74 下一页
摘要: 代码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 邱明成 阅读(110) 评论(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 邱明成 阅读(1752) 评论(0) 推荐(1)
摘要: a1.cpp代码: static int TEST_COMMON = 100; a2.cpp代码: #include <iostream> using namespace std; extern int TEST_COMMON; int main(int argc, char const *argv 阅读全文
posted @ 2021-11-07 14:53 邱明成 阅读(267) 评论(0) 推荐(0)
摘要: #include <iostream> using namespace std; int& GetStaticVar() { static int a = 100; a++; return a; } int main(int argc, char const* argv[]) { cout << G 阅读全文
posted @ 2021-11-07 14:24 邱明成 阅读(606) 评论(1) 推荐(0)
摘要: 一:知识点: 成员函数末尾增加const1)该函数被称为常量成员函数2)在函数的定义和声明处的末尾都要加const3)该成员函数不能修改类中的任何成员(非mutable修饰的任意成员属性)4)const 类型的类变量,不能调用非常量成员函数5)const和非const类变量,可以调用常量成员函数(c 阅读全文
posted @ 2021-11-07 11:33 邱明成 阅读(205) 评论(0) 推荐(0)
摘要: #include <iostream> #include <string> using namespace std; class Person { public: int id; string name; public: Person() { this->id = 200; cout << "Non 阅读全文
posted @ 2021-11-07 10:10 邱明成 阅读(178) 评论(0) 推荐(0)
摘要: cc 阅读全文
posted @ 2021-10-30 17:00 邱明成 阅读(38) 评论(0) 推荐(0)
摘要: #include <iostream> using namespace std; int g_base_num = 1; class Teacher { public: int id; int* studentIds{nullptr}; int count; public: // 构造函数 Teac 阅读全文
posted @ 2021-10-29 21:20 邱明成 阅读(431) 评论(0) 推荐(0)
摘要: #include <iostream> #include <string> using namespace std; class Array { public: Array() { length = 0; num = NULL; }; Array(int n); int& operator[](in 阅读全文
posted @ 2021-10-29 13:02 邱明成 阅读(63) 评论(0) 推荐(0)
摘要: C 库函数 - longjmp() C 标准库 - <setjmp.h> 描述 C 库函数 void longjmp(jmp_buf environment, int value) 恢复最近一次调用 setjmp() 宏时保存的环境,jmp_buf 参数的设置是由之前调用 setjmp() 生成的。 阅读全文
posted @ 2021-10-27 16:49 邱明成 阅读(104) 评论(0) 推荐(0)
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 74 下一页