<分区>
Possible Duplicate:
Is there a strtol equivalent that does not require a null-terminated string?
strtod with limited string length
我正在尝试将 c 的“字符串”转换为各种 c 数字类型:int、float、long int...我的“字符串”不是以“\0”结尾的字符,但我有每个字符串的长度,所以我必须将字符复制到缓冲区中,在末尾添加 '\0',然后使用 atoi 或 strtol...
是否有一些库/函数已经实现了如下功能?
strToInt(char *str, int str_len)
strToFloat(char *str, int str_len)