/*
// 字符串函数更安全的替代,Strsafe.h 官方文档:
https://docs.microsoft.com/en-us/windows/win32/api/strsafe/
// 官方建议使用更安全的带_s的函数,官方文档:
https://docs.microsoft.com/zh-cn/cpp/c-runtime-library/reference/itoa-s-itow-s?view=msvc-160
ANSI UNICODE 通用
(char.h) (wchar.h) (tchar.h)
char wchar_t TCHAR
char * wchar_t * PTCHAR (PTSTR,LPWSTR,PWSTR,WCHAR)
printf wprintf _tprintf
scanf wscanf _tscanf
atoi _wtoi _ttoi
atol _wtol _ttol
itoa _itow _itot
ltoa _ltow _ltot
atof _wtof _tstof
strlen wcslen _tcslen
strcat wcscat _tcscat
strcpy wcscpy _tcscpy
strcmp wcscmp _tcscmp
LPTSTR 通用字符串,_tcslen 长度(length)
strchr 从左往右查找字符,返回找到的第一个字符位置
strrchr 从右往左查找字符,返回找到的第一个字符位置
_tcschr 通用,从左往右查找字符,返回找到的第一个字符位置
_tcsrchr 通用,从右往左查找字符,返回找到的第一个字符位置
_tcscpy 拷贝
_tcscat 连接
lstrcpyn 带长度拷贝
_tcsicmp stricmp 不区分大小写比较
_tcscmp 区分大小写比较
_tcsnccmp strncmp wcsncmp 区分大小写比较
_ttoi atoi 字符串转数字int
_ttol atol 字符串转数字long
_tstof atof 字符串转数字double
_ltot ltoa 转换成字符串
_itoa_s _ltoa_s 转换成字符串
_tcstol wcstol strtol
TCHAR szBuf[10]{ 0 };
_ltot_s(666, szBuf, 16/*进制*/);
_stprintf 格式化
_sntprintf _snprintf 格式化
_tprintf_s _tprintf printf wprintf 打印函数
_tcsupr _strupr 大写化
_tcslwr strlwr 小写化
_stscanf sscanf 格式化获得数值
LPCTSTR _tcsclen 长度
lstrlenW (Unicode)
lstrlenA (ANSI)
*/
C/C++/VC/MFC 通用字符串操作函数、通用字符串类型
最新推荐文章于 2024-05-11 22:18:02 发布