C++问题总结
JShaw
Life to be Real.
展开
-
c++ string ==和compare有啥区别?
c++ string ==和compare有啥区别?摘自stackoverflow:Suppose consider two string s and t.Give them some values.When you compare them using (s==t) it returns a boolean value(true or false , 1 or 0).But when you compare using s.compare(t) ,the expression returns a原创 2021-05-10 20:22:18 · 1193 阅读 · 0 评论 -
CMap,CString,LPCSTR相关问题
CMap说明头文件:afxtempl.hCMap的格式:template<class KEY, class ARG_KEY, class VALUE, class ARG_VALUE >class CMap : public CObjectKey:用作Key的类型(比如整型、浮点型等)ARG_KEY:Key的值VALUE: 用作VALUE的类型ARG_VALUE:用作VALUE的值参数: KEY对象的类,用作映射的关键码。ARG_KEY参数KEY使用的数据类型,通常为KEY原创 2021-04-06 14:02:52 · 286 阅读 · 0 评论 -
数据处理相关C++
ASCII码图:大小端,字节对齐问题代码验证:#include<iostream>using namespace std;#pragma pack(1) //一字节对齐 输出V(56) 4660(1234)struct TalkFrame { char cFlag; short sb; }*frame;/* big-endian 是高位的放在内存低地址处,低位的放在高地址处。 little-endian 是高位的放在内存高地址处,低原创 2021-04-01 23:25:51 · 98 阅读 · 0 评论