c/c++ 日常积累
基类是抽象类,有(纯)虚函数,子类必须要把所有的都实现啊啊啊!!!!包括子类的析构,你写一个~xx类 = default;也好啊啊啊啊啊啊啊,不然报错!!!!啊啊啊啊啊
流下了悔恨的泪水!!!。。。
大小端,联合体
#include <stdio.h> #include <stdbool.h> union { short i; char x[2]; } a; bool IsBigEndian() { union NUM { int a; char b; }num; num.a = 0x1234; if( num.b == 0x12 ) { return true; } return false; } int main(int argc, char* argv[]) { a.x[0] = 10;//0000 1010 高数据 a.x[1] = 1; //0000 0001 低数据 //在内存中的排列方式(PC默认小端): //低地址 --> 高地址 //高数据 --> 低数据 //0000 0001 0000 0001 printf("%d\n", a.i); printf("%x\n", a.i); printf("%d\n", IsBigEndian()); printf("%lu\n", sizeof(int)); union test1 { int a; char b; char c; } test1; printf("%lu\n", sizeof(union test1)); union test2 { int a; char b; long e } test2; printf("%lu\n", sizeof(union test2)); return 0; }
Linux struct itimerval用法
https://blog.csdn.net/hbuxiaofei/article/details/35569229
网络编程的三个重要信号(SIGHUP ,SIGPIPE,SIGURG)
https://blog.csdn.net/z_ryan/article/details/80952498
Linux 守护进程的原理与实现
https://www.cnblogs.com/zhangming-blog/articles/5946797.htm
c++容器的底层数据结构
https://www.cnblogs.com/smallredness/p/11069489.html
c 联合体和结构体区别
https://blog.csdn.net/sjtudou/article/details/81074916
linux下 监控USB插入事件
https://blog.csdn.net/bytxl/article/details/49759527
Netlink 内核实现分析(一):创建
https://blog.csdn.net/luckyapple1028/article/details/50839395
C与C++混合编程+编译
https://blog.csdn.net/lv_Amelia/article/details/79483481
#ifndef _READERDLL_H #define _READERDLL_H #ifdef WIN32 #ifdef DLL_EXPORTS #define DLL_API extern "C" __declspec(dllexport) #else//DLL_EXPORTS #ifdef __cplusplus #define DLL_API extern "C" __declspec(dllimport) #else//__cplusplus #define DLL_API #endif//__cplusplus #endif//DLL_EXPORTS #else//WIN32 #ifdef __cplusplus #define DLL_API extern "C" #else #define DLL_API #endif //__cplusplus #endif//WIN32 DLL_API void CVR_LogSwitch(bool flag); DLL_API int CVR_GetSAMID(char *SAMID, int *length); DLL_API int CVR_GetStatus(); DLL_API int CVR_InitComm(const char *path, int protocolType); DLL_API int CVR_CloseComm(); DLL_API int CVR_Authenticate(); DLL_API int CVR_AuthenticateForNoJudge(); DLL_API int CVR_Read_Content(int active); DLL_API int CVR_Read_FPContent(int active); DLL_API int CVR_FindCard (); DLL_API int CVR_SelectCard(); DLL_API int CVR_AnalysisCardInfo(unsigned char *infoBuff, int infoLen); DLL_API int GetPeopleName(char *strTmp, int *strLen); DLL_API int GetPeopleSex(char *strTmp, int *strLen); DLL_API int GetPeopleNation(char *strTmp, int *strLen); DLL_API int GetPeopleBirthday(char *strTmp, int *strLen); DLL_API int GetPeopleIDCode(char *strTmp, int *strLen); DLL_API int GetDepartment(char *strTmp, int *strLen); DLL_API int GetStartDate(char *strTmp, int *strLen); DLL_API int GetEndDate(char *strTmp, int *strLen); DLL_API int GetCertType (unsigned char * strTmp, int *strLen); DLL_API int GetFPDate (unsigned char *pData, int * pLen); DLL_API int GetPeopleAddress (char *strTmp, int *strLen); DLL_API int GetPassCheckID(char *strTmp, int *strLen); DLL_API int GetIssuesNum(char *strTmp, int *strLen); DLL_API int GetBMPData (unsigned char *pData, int * pLen); DLL_API int GetPeopleChineseName(char *strTmp, int *strLen); DLL_API int GetPeopleCertVersion(char *strTmp, int *strLen); DLL_API int ID_GetInfo(int nPortNo, char* extendPort, int nBaudRate, int nTimeout, char* szPhotoHead, char* szPhotoFace, char* szPhotoBack, char* szPhotoCard,char* szIdentityInfo); DLL_API int CVR_MF_HL_Request(unsigned char nMode, unsigned int *pSNR, unsigned short *pTagType); DLL_API int CVR_MF_HL_Write(unsigned char nMode, unsigned int nSNR, unsigned char nBlock, unsigned char nKey[6], unsigned char *pWriteBuff, unsigned int nBuffLen); DLL_API int CVR_MF_HL_Read(unsigned char nMode, unsigned int nSNR, unsigned char nBlock, unsigned char nKey[6], unsigned char *pReadBuff, unsigned int *pBuffLen); #endif//_READERDLL_H
ISO C++11 does not allow conversion from string literal to 'char *'
c++ 11不允许从字符串到char *的转换
将 char *timez = "CCT-08:00"; 改为 char *timez = (char*)"CCT-08:00";
mysql占用CPU超过100%解决过程
https://www.jianshu.com/p/7f7d3c04d609
http://www.voidcn.com/article/p-vuqpnjil-bkg.html
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· winform 绘制太阳,地球,月球 运作规律
· AI与.NET技术实操系列(五):向量存储与相似性搜索在 .NET 中的实现
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 上周热点回顾(3.3-3.9)