字符串转换为数字strtoul

1280阅读 0评论2015-09-17 下雨夜
分类:LINUX

#include<stdio.h>
#include<stdlib.h>

int main()
{
   char *end;
   char test[] = "1230re43ed";
   unsigned long num = 0;
   num = strtoul(test,&end,0);
   printf("num = %d end = %s\n",num,end);    
}
结果:
num = 1230 end = re43ed
上一篇:指针操作实例
下一篇: Linux的Proc文件系统详解