#include<windows.h>
#include <stdio.h>
#include<tchar.h>
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
int WINAPI WinMain(
HINSTANCE hInstance, // handle to current instance
HINSTANCE hPrevInstance, // handle to previous instance
LPSTR lpCmdLine, // command line
int nCmdShow // show state
) {
TCHAR s[] = TEXT("保国乂民,可不敬与!");
size_t a = _tcslen(s);
WCHAR buf[100] = { 0 };
wsprintfW(buf, L"字符串长度是%d", a);
MessageBox(NULL,buf,TEXT("温馨提示"),MB_OK);
return 0;
}
Windows使用TCHAR,字符集为UNICODE编码
最新推荐文章于 2023-12-22 17:40:56 发布