#include < stdlib.h> #include < stdio.h> void main() { char *floatText = "34.12"; double Afloat = strtod(floatText ,NULL); float Bfloat = atof(floatText ); printf("%f, %f",Afloat ,Bfloat ); }
/* Output */
34.120000, 34.120000
#include < stdlib.h> #include < stdio.h> void main() { char *floatText = "34.12"; double Afloat = strtod(floatText ,NULL); float Bfloat = atof(floatText ); printf("%f, %f",Afloat ,Bfloat ); }
No comments:
Post a Comment