//------------------------#include stdio.h#include stdlib.hint main () {char str[30] = 2030300 This is test;

编程学习网为您整理以下代码实例,主要实现:C语言库strtoul()函数,希望可以帮到各位朋友。

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

int main () {
   char str[30] = "2030300 This is test";
   char *ptr;
   long ret;

   ret = strtoul(str, &ptr, 10);
   printf("The number(unsigned long integer) is %lu\n", ret);
   printf("String part is |%s|", ptr);

   return(0);
}