#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