流浪のwolf

卷帝

导航

2024年2月22日

C++ 第四节课 C和C++指针的区别 C的宏函数和C++内联函数的优缺点

摘要: #include <iostream> // 定义一个宏函数 #define ADD(x,y) x+y; // 宏函数具有速度快等特点 但是写代码有些业务比较繁琐,所以C++中使用了内联函数优化 // 在定义函数前面添加一个inline把这个函数变成内联函数 inline int max(int x 阅读全文

posted @ 2024-02-22 23:11 流浪のwolf 阅读(4) 评论(0) 推荐(0) 编辑

C++ 第三节课 指针的使用

摘要: #include <iostream> using namespace std; void show(){ cout << "全局函数" << endl; } struct Stu { int a; void write_code(){ cout << "成员函数" << endl; } }; in 阅读全文

posted @ 2024-02-22 21:38 流浪のwolf 阅读(4) 评论(0) 推荐(0) 编辑