摘要: #include <iostream> using namespace std; class A { public: A(int i); void print(); const int &r; private: const int a; static const int b; // 静态常数据成员 阅读全文
posted @ 2025-06-14 22:57 ChuckLu 阅读(8) 评论(0) 推荐(0)
摘要: #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)