上一页 1 2 3 4 5 6 7 8 9 ··· 399 下一页
摘要: #include <iostream> using namespace std; int main() { char *p = "Hello"; cout << *p << endl; cout << *(p + 1) << endl; cout << p <<endl; char array[] 阅读全文
posted @ 2025-06-14 20:26 ChuckLu 阅读(37) 评论(0) 推荐(0)
摘要: friend functions A friend function is a function that isn't a member of a class but has access to the class's private and protected members. Friend fu 阅读全文
posted @ 2025-06-14 17:53 ChuckLu 阅读(13) 评论(0) 推荐(0)
摘要: 这是组合数递推公式: C(n,k)=C(n−1,k−1)+C(n−1,k)C(n, k) = C(n-1, k-1) + C(n-1, k) 这个公式的来源可以从组合意义上理解,也可以从杨辉三角或归纳法来推导。 🔍 组合意义解释(最常用的推导) 我们要从 nn 个人里选 kk 个人,有两种情况: 阅读全文
posted @ 2025-06-13 21:08 ChuckLu 阅读(37) 评论(0) 推荐(0)
摘要: Order of parameter evaluation in C++ | Peter Bloomfield The low-level details of how data gets passed into a function are often overlooked by programm 阅读全文
posted @ 2025-06-13 20:05 ChuckLu 阅读(17) 评论(0) 推荐(0)
摘要: #include <iostream> using namespace std; class B1 // 基类B1,构造函数有参数 { public: B1(int i) { cout << "constructing B1 " << i << endl; } }; class B2 // 基类B2 阅读全文
posted @ 2025-06-12 15:01 ChuckLu 阅读(37) 评论(0) 推荐(0)
摘要: 在C++中,析构函数的执行顺序与构造函数相反,遵循**LIFO(Last In, First Out)**原则,也就是"后构造先析构"。 基本规则: 对于你的例子: A a1; // 先构造 A a2; // 后构造 析构顺序是:a2 先析构,a1 后析构 详细说明: 1. 局部对象的析构顺序 vo 阅读全文
posted @ 2025-06-12 14:41 ChuckLu 阅读(138) 评论(0) 推荐(0)
摘要: #include <iostream> using namespace std; class A { public: virtual void f() { cout << 1; } void g() { cout << 2; } }; class B : public A { public: vir 阅读全文
posted @ 2025-06-12 13:43 ChuckLu 阅读(21) 评论(0) 推荐(0)
摘要: That's the million-dollar question for many C/C++ developers! It's definitely tricky at first. Here are some effective strategies to help you memorize 阅读全文
posted @ 2025-06-10 16:30 ChuckLu 阅读(13) 评论(0) 推荐(0)
摘要: C++ 输出中文时,cout 会直接将字符流发送到控制台。如果你写入的是 UTF-8 编码的内容,但控制台(终端、cmd、VS 控制台)不是用 UTF-8 解码,就会显示乱码,比如: “你好” 变成 “浣犲ソ” 这是 UTF-8 编码的“你好”被用 GBK 解码后的结果。 #include <win 阅读全文
posted @ 2025-06-09 17:03 ChuckLu 阅读(111) 评论(0) 推荐(0)
摘要: 2025-06-30 index word pronunciation parts of speech explanation translation in Chinese 1 lobe /loʊb/ noun 1. a rounded projection or division, especia 阅读全文
posted @ 2025-05-31 23:40 ChuckLu 阅读(49) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 9 ··· 399 下一页