随笔分类 - C/C++
摘要:如果六个字母不同则有A66 种方法 但有两个字母重复,一个字母重复是除以2,两个就是A66 /4=180
阅读全文
摘要:[https://www.libxl.com/](https://www.libxl.com/)
阅读全文
摘要:在 C++ 中使用 CreateThread() 函数可以创建一个新线程。以下是使用 CreateThread() 函数的基本示例: #include <Windows.h> #include <iostream> using namespace std; // 线程入口函数 DWORD WINAP
阅读全文
摘要:MFC中可以通过以下步骤实现只运行一个实例: 定义一个唯一的标识符,在应用程序的头文件中声明: #define SINGLE_INSTANCE_GUID "{12345678-1234-5678-9012-345678901234}" 在InitInstance()函数中,创建一个互斥体并检查互斥体
阅读全文
摘要:以下是 C 语言实现 HTTP 文件下载的断点续传示例代码。假设要下载的文件 URL 为 http://example.com/example.zip,本地保存为 example.zip。 #include <stdio.h> #include <stdlib.h> #include <curl/c
阅读全文
摘要:#include <iostream> #include <fstream> #include <boost/asio.hpp> using boost::asio::ip::tcp; int main() { try { boost::asio::io_service io_service; //
阅读全文
摘要:只两天在做C++的开发,需要一个时间的字符串,星期为中文,精确到毫秒。网上查了一些资料总结如下: #include <windows.h> string getTimeNow() { SYSTEMTIME sys; GetLocalTime(&sys); char nowTime[40]; char
阅读全文
摘要:很多时候,柔性数组应用在了变长结构体中,如: StructPacket { Int state; Int len; Char cData[0]; //这里的0长结构体就为变长结构体提供了非常好的支持 }; 首先对0长数组做一个解释: 用途 :长度为0的数组的主要用途是为了满足需要变长度的结构体。 用
阅读全文
摘要:三种方式实现vector的自定义排序 方法1:重载运算符 #include <vector> #include <algorithm> #include <functional> using namespace std; struct TItem { int m_i32Type; int m_i32
阅读全文

浙公网安备 33010602011771号