转化字符串为数值结果

2018-06-06  本文已影响0人  五秋木

代码如下:

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

上一篇 下一篇

猜你喜欢

热点阅读