标签:
应用实例:
#include <stdlib.h> #include <stdio.h> int main() { char *a="-100.23"; float c = 0; c=atof(a); printf("c:%f\n",c); printf("atof(200e-2):%f\n",atof("200e-2")); printf("atof(123%^456):%f\n",atof("123%^456")); printf("atof(200e-2):%f\n",atof("#$%123%^098")); printf("atof( ):%f\n",atof(" ")); printf("atof(0.02):%f\n",atof("0.02")); printf("atof(145):%f\n",atof("145")); printf("atof($#@!):%f\n",atof("$#@!")); return 0; }运行结果:
标签:
原文地址:http://blog.csdn.net/kongshuai19900505/article/details/52220207