C语言库strtoul()函数

//------------------------#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);
}
本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐