上一页 1 2 3 4 5 6 7 ··· 56 下一页
摘要: // 辅助函数:计算 10 的幂 constexpr int pow10(int n) { return n == 0 ? 1 : 10 * pow10(n - 1); } template <int... Num> struct NumCat; template <int First, int.. 阅读全文
posted @ 2025-03-17 23:21 double64 阅读(37) 评论(0) 推荐(0)
摘要: 传递自定义类型 如果需要传递自定义类型,必须先注册该类型。 #include <QApplication> #include <QPushButton> #include <QDebug> #include <thread> #include <chrono> // 自定义类型 struct Cus 阅读全文
posted @ 2025-03-16 21:56 double64 阅读(357) 评论(0) 推荐(0)
摘要: 一 . using class A { public: void Hello() { cout << "hello" << endl; } void Hi() { cout << "Hi" << endl; } }; class B :public A { private: using A::Hi; 阅读全文
posted @ 2025-03-15 23:08 double64 阅读(29) 评论(0) 推荐(0)
摘要: ui->lbl_cupInfo->setText("hello,good,morning,jksfsafsflkasjflksajfsjf"); ui->lbl_cupInfo->adjustSize(); 阅读全文
posted @ 2025-03-01 10:12 double64 阅读(22) 评论(0) 推荐(0)
摘要: class A { public: virtual ~A() {} int a{ 100 }; int b{ 200 }; }; class B :public A { public: B() = default; B(const B&b) //:A(b) // OK, 委托构造函数形式 { A:: 阅读全文
posted @ 2025-02-27 19:22 double64 阅读(19) 评论(0) 推荐(0)
摘要: std::vector<int> arr = {0,1,2,3,4,5 }; auto it = std::find(arr.begin(), arr.end(), 3); auto index = it - arr.begin(); std::cout << "[" << index << "]" 阅读全文
posted @ 2025-02-15 11:09 double64 阅读(132) 评论(0) 推荐(0)
摘要: 如果有一个基类: class Dog { public: virtual ~Dog() {} void show(int a) { cout << "我是一只狗!" << a << "岁" << '\n'; } void mysong() { cout << "哈哈哈..." << '\n'; } 阅读全文
posted @ 2025-01-21 14:43 double64 阅读(22) 评论(0) 推荐(0)
摘要: 服务端 // 服务端 #include <cstdio> #include <cstdlib> #include <WinSock2.h> #include <Ws2tcpip.h> // inet_pton 函数所在头文件 #pragma comment(lib, "ws2_32.lib") // 阅读全文
posted @ 2024-12-21 21:43 double64 阅读(44) 评论(0) 推荐(0)
摘要: QTextCursor cursor = ui.textEdit_Recive->textCursor(); cursor.movePosition(QTextCursor::End); // 移动光标到文档末尾 ui.textEdit_Recive->setTextCursor(cursor); 阅读全文
posted @ 2024-12-19 11:56 double64 阅读(420) 评论(0) 推荐(0)
摘要: 对 C 语言构成要素的一点思考: 数组 // 泛指容器 枚举 // 与数组配合 结构体 指针 函数 阅读全文
posted @ 2024-12-06 13:46 double64 阅读(30) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 ··· 56 下一页