4918
5880
3万
GROAD
曲径通幽,安觅芳踪。
#include <stdlib.h> int atoi(const char *nptr); [/table]举例: include <stdio.h>#include <stdlib.h> int main(int arvc, char **argv) { printf ("%d ", atoi(argv[1])); return (0); } [table=100%,#f9f7ed]运行输出: # ./atoi 123 123 如果 argv[1] 指定为 123abc ,那么仍然可以正确转换 123 ,即自动忽略掉后面的 abc ,但不能指定 abc123efg 这样的形式,即转换字符串的开始字符一定要是数字形式的。
# ./atoi 123 123
使用道具 举报
本版积分规则 发表回复 回帖后跳转到最后一页
小黑屋|手机版|Archiver|曲径通幽 ( 琼ICP备11001422号-1|公安备案:46900502000207 )
GMT+8, 2025-5-6 17:15 , Processed in 0.079337 second(s), 23 queries .
Powered by Discuz! X3.2
© 2001-2013 Comsenz Inc.