随笔- 191  文章- 0  评论- 3  阅读- 59130 

随笔分类 -  backend / c++

1
cmake + JNI
摘要:目录结构: |-HelloWorld |--src | main | java | main.java | cpp //和java目录同级 | CMakeLists.txt //cmake配置文件 | src // c\c++ 源文件目录 | HelloWorld.cpp | build // 生成 阅读全文
posted @ 2024-07-15 01:32 laremehpe 阅读(25) 评论(0) 推荐(0) 编辑
c++ 计算mp3时长
摘要:#include <stdio.h> #include <iostream> #include <fstream> #include <string> using namespace std; struct ID3V2 { char tag[3]; char version; char subVer 阅读全文
posted @ 2024-07-13 16:24 laremehpe 阅读(74) 评论(0) 推荐(0) 编辑
c++ 分割字符串
摘要:#include "iostream" #include "vector" #include "string" using namespace std; vector<string> split(string txt, string splitor) { vector<string> strList 阅读全文
posted @ 2024-05-27 15:16 laremehpe 阅读(8) 评论(0) 推荐(0) 编辑
c++ wchar拼接
摘要:WCHAR* concatWcharStr(const WCHAR* str1, const WCHAR* str2) { size_t len1 = wcslen(str1) * 2; size_t len2 = wcslen(str2) * 2; size_t len3 = len1 + len 阅读全文
posted @ 2024-01-04 14:37 laremehpe 阅读(117) 评论(0) 推荐(0) 编辑
c++ md5文件校验
摘要:// main.cpp#include <stdio.h> #include <iostream> #include <string> #include "md5.h" #include <fstream> using namespace std; int getFileSize(ifstream* 阅读全文
posted @ 2024-01-03 16:06 laremehpe 阅读(85) 评论(0) 推荐(0) 编辑
c++ 复制文件路径
摘要:#include <stdio.h> #include <iostream> #include <string> #include <windows.h> #include <fstream> using namespace std; void writeFile(string path,strin 阅读全文
posted @ 2024-01-03 10:25 laremehpe 阅读(24) 评论(0) 推荐(0) 编辑
c++ 无弹窗执行cmd命令
摘要:void prompt(LPWSTR szCmd) { TCHAR szModuleName[MAX_PATH]; STARTUPINFO si = { 0 }; PROCESS_INFORMATION pi = { 0 }; GetModuleFileName(NULL, szModuleName 阅读全文
posted @ 2023-09-26 15:04 laremehpe 阅读(208) 评论(0) 推荐(0) 编辑
win下编译libcurl x86静态库 (附带ssl)
摘要:Visual Studio版本: 克隆libcurl项目: git clone https://github.com/curl/curl.git 添加依赖(ssl): 在拷贝的项目下添加deps目录: 在deps下创建lib和include目录: 关于编译openssl参考: https://www 阅读全文
posted @ 2023-09-26 11:28 laremehpe 阅读(411) 评论(0) 推荐(0) 编辑
c++ 删除自己
摘要:How to write a program in C++ such that it will delete itself after execution? - Stack Overflow #include <strsafe.h>#include <Windows.h> #define SELF_ 阅读全文
posted @ 2023-09-25 16:30 laremehpe 阅读(66) 评论(0) 推荐(0) 编辑
c++ chat* 转 wchar*
摘要:wchar_t* charToWchar(const char* src) { size_t size = strlen(src) + 1; wchar_t* dest = new wchar_t[size]; size_t outSize; mbstowcs_s(&outSize, dest, s 阅读全文
posted @ 2023-09-22 11:01 laremehpe 阅读(35) 评论(0) 推荐(0) 编辑
c++ long类型转char
摘要:int NumberAt(long num, int unit) { while (unit-- > 0) num /= 10; return num % 10; } int NumberLength(long num) { int len = 1, sum = 10; while (num >= 阅读全文
posted @ 2023-09-21 14:35 laremehpe 阅读(264) 评论(0) 推荐(0) 编辑
c++ 读写注册表
摘要:class CConfig { HKEY _hKey; public: ~CConfig() { if (_hKey) { RegCloseKey(_hKey); } } CConfig() : _hKey(0) { } LSTATUS Save( PCWSTR lpValueName, DWORD 阅读全文
posted @ 2023-09-21 11:24 laremehpe 阅读(134) 评论(0) 推荐(0) 编辑
c++ 简单模拟js Promise
摘要:main: #include <stdio.h> #include "common.h" #include "promise.h" #include <chrono> // std::chrono::seconds #include <thread> // std::this_thread::sle 阅读全文
posted @ 2023-09-21 09:34 laremehpe 阅读(62) 评论(0) 推荐(0) 编辑
c++创建简单窗口
摘要:#include <stdio.h> #include <Windows.h> void __cdecl OutputDebugPrintf(const char* format, ...) { va_list vlArgs; char* strBuffer = (char*)GlobalAlloc 阅读全文
posted @ 2023-09-09 14:13 laremehpe 阅读(58) 评论(0) 推荐(0) 编辑
c++字符串搜索之KMP
摘要:class Solution { private: void getNext(int* arr, string str) { int len = str.length(); arr[0] = 0; int j = 0; for (int i = 1; i < len; i++) { while (j 阅读全文
posted @ 2023-07-29 14:50 laremehpe 阅读(4) 评论(0) 推荐(0) 编辑
vs修改键盘快捷键
摘要:找到options选项:(最后一个) 搜索Duplicate: 连续点击Remove三次,彻底删掉快捷键 然后搜索linedelete: 同上点击remove移除默认快捷键,然后: 输入快捷键: 点击Assign即可: > LineDelete > ctrl + d //删除当前行> InsertN 阅读全文
posted @ 2023-07-24 11:47 laremehpe 阅读(242) 评论(0) 推荐(0) 编辑
vs 控制台输出
摘要:void __cdecl OutputDebugPrintf(const char* format, ...) { va_list vlArgs; char* strBuffer = (char*)GlobalAlloc(GPTR, 4096); va_start(vlArgs, format); 阅读全文
posted @ 2023-05-29 23:22 laremehpe 阅读(393) 评论(0) 推荐(0) 编辑
c++遍历搜索关键字
摘要:#include <iostream> #include <windows.h> #include <string.h> #include <strsafe.h> #define MAX_INPUT_LENGTH 255 using namespace std; void printMemory(c 阅读全文
posted @ 2023-04-25 18:00 laremehpe 阅读(37) 评论(0) 推荐(0) 编辑

1
点击右上角即可分享
微信分享提示