C/C++/VC/MFC 通用字符串操作函数、通用字符串类型

/*
	// 字符串函数更安全的替代,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)
*/

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值