int _istdigit(TCHAR): to test if a string is a number.
int _ttoi(TCHAR*): is the same as atoi, change a string into a int.
if ( _istdigit( strServiceName[0] ) ) { nPortNumber = (USHORT) _ttoi( strServiceName ); }
本文介绍了两个用于处理字符串的C函数:_istdigit用于判断字符串是否为数字;_ttoi用于将字符串转换为整数。这两个函数在特定场景下非常有用,例如当需要解析配置文件或从网络接收的数据中提取端口号时。
int _istdigit(TCHAR): to test if a string is a number.
int _ttoi(TCHAR*): is the same as atoi, change a string into a int.
if ( _istdigit( strServiceName[0] ) ) { nPortNumber = (USHORT) _ttoi( strServiceName ); }
4547
2万+

被折叠的 条评论
为什么被折叠?