← 返回列表

C库函数 - strtol()

C库函数 - strtol() #include <stdio.h> #include <stdlib.h> int main () { char str[30] = "2030300 This is test"; char *ptr; long ret; ret = strtol(str, &ptr, 10); printf("The number(unsigned long integer) is %ld\n", ret); printf("String part is |%s|", ptr); return(0); }

C库函数 - strtol()

#include <stdio.h>

#include <stdlib.h>



int main () {

   char str[30] = "2030300 This is test";

   char *ptr;

   long ret;



   ret = strtol(str, &ptr, 10);

   printf("The number(unsigned long integer) is %ld\n", ret);

   printf("String part is |%s|", ptr);



   return(0);

}

打开资源 ↗

交流与评论