随笔分类 -  c++

工作笔记
摘要:#include <iostream> #include <chrono> #include <ctime> #include <iomanip> #include <sstream> int main() { // 获取当前时间点 auto now = std::chrono::system_cl 阅读全文
posted @ 2025-01-23 16:36 leochan007 阅读(2) 评论(0) 推荐(0) 编辑
摘要:#define STRINGIFY(x) #x int someVariable = 10; std::cout << STRINGIFY(someVariable) << " = " << someVariable << std::endl; 阅读全文
posted @ 2024-12-27 11:37 leochan007 阅读(3) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <sstream> #include <iomanip> #include <ctime> bool compareTimeStrings(const std::string& timeStr1, const std::string& tim 阅读全文
posted @ 2024-12-24 15:47 leochan007 阅读(8) 评论(0) 推荐(0) 编辑
摘要:#include <stdio.h> void print_binary(unsigned int n) { for (int i = sizeof(n) * 8 - 1; i >= 0; i--) { printf("%d", (n >> i) & 1); } printf("\n"); } vo 阅读全文
posted @ 2024-12-12 17:51 leochan007 阅读(3) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <fstream> int main() { std::ifstream sourceFile("source.txt", std::ios::binary); // 打开源文件 if (!sourceFile) { std::cout << 阅读全文
posted @ 2024-01-03 12:31 leochan007 阅读(5) 评论(0) 推荐(0) 编辑
摘要:新手VSCode配置C++20 Makefile教程1 快速入门 HTTP 代理服务器的设计与实现(C++) 阅读全文
posted @ 2023-12-05 11:49 leochan007 阅读(8) 评论(0) 推荐(0) 编辑
摘要:// testfindfile.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 // #include <iostream> #include <windows.h> bool SearchFilesByWildcard(const WCHAR* wildcardPath) 阅读全文
posted @ 2023-11-02 16:43 leochan007 阅读(59) 评论(0) 推荐(0) 编辑
摘要:// testmutex.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 // #include <iostream> #include "windows.h" HANDLE m_hMutex; #include<list> using namespace std; lis 阅读全文
posted @ 2023-05-24 15:34 leochan007 阅读(6) 评论(0) 推荐(0) 编辑
摘要:C++中将string类型转换为double的方法:#include <iostream>#include <sstream> //使用stringstream需要引入这个头文件using namespace std;//模板函数:将string类型变量转换为常用的数值类型(此方法具有普遍适用性)t 阅读全文
posted @ 2023-02-08 14:51 leochan007 阅读(57) 评论(0) 推荐(0) 编辑
摘要://Log.h #ifndef LOG_HEAD_DEF #define LOG_HEAD_DEF #pragma once #include "stdio.h" #include <stdarg.h> ////用变参函数所必须的 #include <time.h> #include <direct 阅读全文
posted @ 2022-12-03 21:19 leochan007 编辑
摘要:#include <iostream> #define new_fun(parm) print##parm("this is a printf\r\n"); int main() { //new_fun(oh); //无法编译通过 new_fun(f); getchar(); return 0; } 阅读全文
posted @ 2022-10-26 17:32 leochan007 阅读(42) 评论(0) 推荐(0) 编辑
摘要://Minidump.h #pragma once class CMinidump { public: CMinidump(); ~CMinidump(); static void CreateDumpFile(LPCSTR lpstrDumpFilePathName, EXCEPTION_POIN 阅读全文
posted @ 2022-10-23 14:38 leochan007 编辑
摘要:#include <iostream> void getfilename(const char* filename, char* name)//从完整路径名中解析出文件名称,例如:/home/test/abc.txt,解析完成后为abc.txt { int len = strlen(filename 阅读全文
posted @ 2022-07-27 16:48 leochan007 阅读(368) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include<direct.h> #include<io.h> bool CheckPathExist(std::string path) { if (access(path.c_str(), 0) == -1) { return false; } ret 阅读全文
posted @ 2022-03-18 16:18 leochan007 阅读(357) 评论(0) 推荐(0) 编辑
摘要:// encripe_test.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 // #include <string> #include <iostream> using namespace std; //int key[] = { 1,2,3,4,5,6,7 }; in 阅读全文
posted @ 2022-03-09 21:27 leochan007 阅读(409) 评论(0) 推荐(0) 编辑

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