C语言字符串转整型及分隔字符串代码讲解
程序员文章站
2022-06-24 20:31:45
字符串转整型
#include
...
char cs[] = "123";
int num = atoi(cs);
分隔字符串
#i...
字符串转整型
#include ... char cs[] = "123"; int num = atoi(cs);
分隔字符串
#include ... char str[] = "I am student"; char *ptr; ptr = strtok(str, " "); while (ptr != NULL) { print("%s",ptr); //输出每一个字符/字符串 ptr = strtok(NULL, " "); }