摘要:
this指针 this指针的指向 this指针指向被调用的成员函数所属的对象 #include <iostream> #include <cstdlib> using namespace std; class Person { public: int a; void func(int var) { 阅读全文
摘要:
https://mp.weixin.qq.com/s/E6ToXjBLAZljOXWeFmrUqw 阅读全文
摘要:
材料 一个U盘/移动硬盘(最好大一点) VMware Ubuntu18.04镜像文件(比较稳定) 开始 做虚拟机 https://blog.csdn.net/weixin_42533541/article/details/81877207 安装到U盘 将U盘连接到虚拟机 前面的配置 分区 分完上面的 阅读全文
摘要:
前端自适应 仅需添加如下代码: <meta name="viewport" content="width=device-width, initial-scale=1.0"> 阅读全文
摘要:
环境搭建 VSCode 下载 地址:https://code.visualstudio.com/ 插件 Live Server 实时刷新浏览器 效果: 阅读全文
摘要:
单例模式 附:设计模式教程 上面的教程来自C语言中文网,网址:http://m.biancheng.net/design_pattern/ 静态成员变量 在类的定义中,它的成员(包括成员变量和成员函数),这些成员可以用关键字static修饰,声明为静态的,叫做静态成员 不管类创建了多少个对象,静态成 阅读全文
摘要:
官网:https://typora.io/ 使用教程:https://www.cnblogs.com/wzos/articles/12246449.html 阅读全文
摘要:
类和对象 引出 设计圆类 #include <cstdio> #include <cstdlib> #include <iostream> using namespace std; const double PI = 3.1415926; // 圆类 // 语法:class 类名(首字母大写) cl 阅读全文
摘要:
函数 默认参数 #include <cstdlib> #include <cstdio> // 默认参数必须写在最后面,例如:int func(int a,int b = 0, int c = 2) void test(int a, int b = 10) { printf("%d + %d = % 阅读全文
摘要:
内联函数 宏函数的缺点 缺陷1:要加小括号,保证运算完整 缺陷2:即使加了括号,有时也与预期不符 内联函数 本质也是一个普通函数,在适当时候会替换源码 注意 不能存在循环语句 不能存在过多条件判断语句 函数体不能过于庞大 不能对函数进行取址操作 语法 inline 函数() { // ... } 例 阅读全文