随笔分类 -  C++

摘要:指针函数 和 函数指针 指针函数(Function Returning a Pointer) > 返回一个指针 指针函数是返回指针的函数。也就是说,这种函数的返回类型是一个指针。 定义和使用 指针函数的返回类型是一个指针类型 通过函数调用,返回一个指针 Demo #include <iostream 阅读全文
posted @ 2024-08-26 00:53 爱新觉罗LQ 阅读(62) 评论(0) 推荐(0) 编辑
摘要:typedef 指针定义 #include <iostream> #include <string> #include <vector> using namespace std; typedef unsigned int UInt32; // 1. 简化类型 typedef float Real; 阅读全文
posted @ 2024-08-25 10:45 爱新觉罗LQ 阅读(6) 评论(0) 推荐(0) 编辑
摘要:OOP 1. 继承 基类(base) 派生类(derived) 派生类需要访问的基类的成员:在基类中用 protected 来修饰 虚函数(Virtual) 基类希望派生类各自定义自己合适的版本 基类通常都应该定义一个虚析构函数,即使该函数不执行任何实际操作也是如此 阅读全文
posted @ 2024-08-20 00:31 爱新觉罗LQ 阅读(8) 评论(0) 推荐(0) 编辑
摘要:C++面试题 1. 运算符优先级别 # *p++ 你理解么? 位置是要变化的,但是这个值本身还是变之前的 阅读全文
posted @ 2024-08-19 00:02 爱新觉罗LQ 阅读(8) 评论(0) 推荐(0) 编辑
摘要:C++ 数据结构 1. 标准库 https://www.runoob.com/cplusplus/cpp-standard-library.html 2. Vector https://www.runoob.com/w3cnote/cpp-vector-container-analysis.html 阅读全文
posted @ 2024-08-18 23:34 爱新觉罗LQ 阅读(4) 评论(0) 推荐(0) 编辑
摘要:指针 1. 指针的作用 使程序简洁、紧凑、高效 有效地表示复杂的数据结构 动态分配内存 能直接访问硬件 能够方便的处理字符串 得到多于一个的函数返回值 2. 指针和指针变量 指针初始化 int main() { int a = 10; int * p = &a; // p 是指针变量,p 的内容为 阅读全文
posted @ 2024-08-13 01:06 爱新觉罗LQ 阅读(17) 评论(0) 推荐(0) 编辑
摘要:VSCode 快捷键 1. .h 文件和 .cpp 文件切换 Alt + O 2. 复制上一行 # 默认 shift + Alt + ↓ # 改为 Ctrl + D 3. 选中当前列 alt + shift + 鼠标左键 > 选中列 4. 定位到具体某一行(Ctrl + G) Ctrl + G 5. 阅读全文
posted @ 2024-07-21 12:28 爱新觉罗LQ 阅读(56) 评论(0) 推荐(0) 编辑
摘要:回调函数(CallBack) 1. 定义 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>数组定义</title> <script type="text/javascript"> // 先定义一个函数,用来做 阅读全文
posted @ 2024-07-19 00:26 爱新觉罗LQ 阅读(25) 评论(0) 推荐(0) 编辑
摘要:Essential C++ 1. 构造函数初始化语法(constructor initialization syntax) 处理多值初始化 C++支持 3 种浮点数型别 float double extended precision:扩展精度 2. const 关键词(永恒不变) const int 阅读全文
posted @ 2024-07-14 01:16 爱新觉罗LQ 阅读(38) 评论(0) 推荐(0) 编辑
摘要:Hello World 1. 安装插件 2. 安装编译器 “MinGW" https://cloud.tencent.com/developer/article/1944563 https://sourceforge.net/projects/mingw-w64/files/ 3. 配置 inclu 阅读全文
posted @ 2024-06-29 01:16 爱新觉罗LQ 阅读(37) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示