![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C/C++
yjj453458624
这个作者很懒,什么都没留下…
展开
-
strlen,wcslen,lstrlen,sizeof及wstring
在Unicode下,lstrlen等同lstrlenW(LPCWSTR lpString),在非Unicode下等同lstrlenA(LPCSTR lpString)。而lstrlenW又等同于wcslen,lstrlenA又等同于strlen,只不过一个是C的标准函数,一个是WinAPI函数。 #ifdef UNICODE #define lstrlen lstrlenW #else原创 2015-03-09 11:53:50 · 521 阅读 · 0 评论 -
位域/字节对齐
#include "stdafx.h" #include "windows.h" int _tmain(int argc, _TCHAR* argv[]) { typedef struct { unsigned char a:2; unsigned char :3; unsigned char b:7; unsigned char d:2; } BIT_原创 2015-10-29 22:57:02 · 371 阅读 · 0 评论 -
有关内存的思考题
有关内存的思考题 1、 void GetMemory(char *p) { p = (char *)malloc(100); } void Test(void) { char *str = NULL; GetMemory(str); strcpy(str, "hello world"); printf(str); } 请问运行Test原创 2015-03-09 14:06:13 · 288 阅读 · 0 评论 -
回调函数
标准Hello World程序: ------------------------------------------------------- int main(int argc,char* argv[]) { printf("Hello World!\n"); return 0; } ----------------------------------------原创 2015-03-09 12:02:58 · 216 阅读 · 0 评论 -
Big-endian
一.将双字节转成2个单字节,eg:0x1100-->0x11和0x00 #define HI_UINT16(a) (((a) >> 8) & 0xFF) #define LO_UINT16(a) ((a) & 0xFF) --------------------------------------------------------- 二.判断是大端模式还是小端模式 int checkC原创 2015-03-09 12:01:10 · 358 阅读 · 0 评论 -
split/char-wchar/文件操作
#pragma once #include #include using namespace std; //分割字符串,之间用逗号分开 void CO_Split(const wstring &src, wstring separate_character,vector& strs) { //分割字符串长度,这样就可以支持多字符串的分隔符 int separate_char原创 2015-03-09 11:51:46 · 372 阅读 · 0 评论 -
C++ DLL调用
一:先编写生成一个dll,这里用一个原创 2015-06-10 20:08:37 · 517 阅读 · 4 评论