代码如下:
char s[]="0.096147 0.048460 -0.098422";
char d[] = " ";
char *t;
t = strtok(s, d);
while(t != NULL){
printf("%s\n", t);
t = strtok(NULL, d);
}
可以参考: C语言字符串分割——strtok
代码如下:
char s[]="0.096147 0.048460 -0.098422";
char d[] = " ";
char *t;
t = strtok(s, d);
while(t != NULL){
printf("%s\n", t);
t = strtok(NULL, d);
}
可以参考: C语言字符串分割——strtok
本文标题:转化字符串为数值结果
本文链接:https://www.haomeiwen.com/subject/hxzbsftx.html
网友评论