上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 56 下一页
摘要: #include <string> #include <iostream> using namespace std; namespace { class Animal { public: Animal() { cout << "基类调用虚函数…" << endl; cout << GetInfo() 阅读全文
posted @ 2024-08-23 20:31 double64 阅读(17) 评论(0) 推荐(0)
摘要: #include <string> #include <iostream> using namespace std; namespace { class Animal { public: string GetInfo() { return "我是动物"; } }; class Dog :public 阅读全文
posted @ 2024-08-23 19:42 double64 阅读(10) 评论(0) 推荐(0)
摘要: C++ #include <functional> #include <iostream> #include <vector> #include <memory> #include <set> #include <map> #include <string> using namespace std; 阅读全文
posted @ 2024-08-22 23:18 double64 阅读(27) 评论(0) 推荐(0)
摘要: #include <iostream> #include <string> #include <memory> using namespace std; namespace { class B; class A { public: std::shared_ptr<B> pb; }; class B 阅读全文
posted @ 2024-08-15 12:19 double64 阅读(13) 评论(0) 推荐(0)
摘要: ui.tabObj->insertTab(0, widgetObj1, tr("tabName0")); ui.tabObj->insertTab(1, widgetObj1, tr("tabName1")); ui.tabObj->insertTab(2, widgetObj2, tr("tabN 阅读全文
posted @ 2024-08-13 15:52 double64 阅读(73) 评论(0) 推荐(0)
摘要: #include <iostream> #include <string> namespace { class A { public: void addCount() { ++sumCount; } static int getSumCount() { return sumCount; } priv 阅读全文
posted @ 2024-07-19 19:49 double64 阅读(17) 评论(0) 推荐(0)
摘要: #include <iostream> #include <string> namespace { class A { public: const A& get_self() const { std::cout << "常量版本" << std::endl; return *this; } A& g 阅读全文
posted @ 2024-07-19 14:46 double64 阅读(11) 评论(0) 推荐(0)
摘要: C++ class 和 struct 可以相互继承吗? #include <iostream> #include <string> namespace { class A { public: std::string name = "小明"; }; struct B :public A { int a 阅读全文
posted @ 2024-07-19 11:30 double64 阅读(72) 评论(0) 推荐(0)
摘要: C++ 返回数组指针简单测试: #include <iostream> static const size_t ARR_SIZE = 10; static int arr[ARR_SIZE]; // 更新数组 #define UPDATE_ARR_DATA(i) for (size_t j = 0; 阅读全文
posted @ 2024-07-18 14:19 double64 阅读(18) 评论(0) 推荐(0)
摘要: #include <iostream> #include <string> static void show_msg(std::initializer_list<std::string> str_list) { for (auto beg = str_list.begin(); beg != str 阅读全文
posted @ 2024-07-18 13:00 double64 阅读(12) 评论(0) 推荐(0)
上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 56 下一页