随笔分类 - C/C++
摘要:源地址 #include <algorithm> #include <iostream> #include <ostream> #include <bsoncxx/json.hpp> #include <bsoncxx/stdx/make_unique.hpp> #include <mongocxx
阅读全文
摘要:链接 SetCommState的struct _DCB类型参数,其值 StopBits= 0,1,2对应的是1bit,1.5bits,2bits ByteSize = 6, 7, 8时StopBits不能为1 ByteSize = 5时StopBits不能为2
阅读全文
摘要:博客 // GetConnection()自定义函数,获取连接指针,类型_ConnectionPtr _ConnectionPtr pConnection = GetConnection(); _CommandPtr pCommand; _RecordsetPtr pRs; try{ pComman
阅读全文
摘要:实现 #pragma once #ifndef _LOG_CPP_HPP_ #define _LOG_CPP_HPP_ #include <iostream> #include <string> #include <deque> #include <chrono> #include <thread>
阅读全文
摘要:个人文章地址 1. 头文件 #pragma once #include <string> #include <memory> #include <tuple> #include <functional> #include <thread> template<typename T> class Thr
阅读全文
摘要:链接 数据结构 Linux平台 #include <iostream> #include <netinet/in.h> #include <arpa/inet.h> #include <sys/socket.h> #include <netdb.h> #include <sys/unistd.h>
阅读全文
摘要:链接 HTTP包格式 基本请求格式 基本响应格式 暴力解析代码及测试(记得加参数-std=c++2a) #include <iostream> #include <map> #include <utility> #include <netinet/in.h> #include <cstring> #
阅读全文
摘要:首发地址 搭配表 根据搭配表暴力生成所有拼音组合 std::vector<std::string> TABLE = []() { std::vector<std::string> master{"", "b", "p", "m", "f", "d", "t", "n", "l", "g", "k",
阅读全文
摘要:rw_ini_base 使用C++标准库解析ini格式文件,只提供解析后的表和写入函数,查询、修改等功能可自行添加函数 个人博客地址:https://www.blog.hiyj.cn/article/detail/114 源码链接:https://github.com/WindSnowLi/rw_i
阅读全文
摘要:一、选择排序 java选择排序示例 /** * Describe : java选择排序 */ import java.util.Arrays; public class Sort { public static void main(String[] args) { int[] arr = { 2,
阅读全文
摘要:注1:MySQL自带的库连接数据库看着太不和谐,这里使用sqlpp11以及其配套的sqlpp11-connector-mysql[mysql]连接数据库 注2:sqlpp11-connector-mysql[mysql]安装有个坑,可以使用vcpkg install sqlpp11-connecto
阅读全文
摘要:#include <iostream> #include <functional> #include <queue> #include <atomic> #include <mutex> #include <thread> #include <future> #include <memory> #i
阅读全文
摘要:以连接Mysql所需的依赖库为例 1. 为插件添加头文件目录,不然语法检查提示错误 2. 项目根文件夹命名有空格,在根文件夹下有bin、include、lib、src三个文件夹 3. include下创建头文件a.cpp,内含 #ifndef DAtACONNECTION_H_ #define DA
阅读全文
摘要:1. 生成项目文件 左上角文件—》工作区另存为–》找到另存为的.code-workspace文件(该文件可以理解为是vscode的项目启动文件)–》右键以记事本打开该文件–》在里边的settings项下添加一项 "code-runner.executorMap": { "cpp": "cd $dir
阅读全文
摘要:Windows写入注册表自启动键值对消失: Windows程序将程序路径写入注册表自启动时,有时可能会遇到写入成功但是注册表依然空白的问题。并且随意的字符串可以正常写入,但是写入程序路径时键与值会直接消失。 问题描述: 最初写MFC时遇到过上述情况,最后通过写入RunOnce,并在Run下写入一个标
阅读全文
摘要:寻找迷宫出口的最短步数C++实现。 #include <iostream> #include <fstream> #include <cstring> #include <string> #include <queue> using namespace std; //标记全图状态,已经访问的按钮为1
阅读全文
摘要:#include <iostream> #include <fstream> #include <algorithm> #include <vector> #include <ctime> #ifdef linux #include <unistd.h> #endif // linux #if de
阅读全文
摘要:MFC基于vlc播放器的视频壁纸程序 详见最新版源码https://github.com/WindSnowLi/DynamicWallpaper 最初版源码项https://download.csdn.net/download/qq_44575789/12152673 最新版Qt重写版本https:
阅读全文
摘要:C++获取流长度 #include <iostream> #include <fstream> using namespace std; int main() { ifstream File_test1; //以读取方式打开jpg文件 File_test1.open("1.jpg", std::io
阅读全文
摘要:C++非文本文件写入混乱 C++使用fstream读取非文本文件时,一般常规读取就可以,例如将图片读取出来并存储到char数组 ifstream File_test1; //以读取方式打开jpg文件 File_test1.open("1.jpg", std::ios::in); //定位到文件末尾
阅读全文