Hi Martin,
Thank you for your reply.. Here is the test code which i have tried..
| int integer; |
| float flot; |
| uchar ascii_int[] = "12345"; |
| uchar ascii_float[] = "54321.54321"; | | integer = atoi(ascii_int); | | | printf("The integer value is %d\n\r", integer); | | | flot = atof(ascii_float); | | | printf("The float value is %f\n\r", flot); |
|
The output follows,
The integer value is 12345
The flot value is 1643769856.000000
So the output shows atoi is working fine & atof is not giving proper output. To make sure that there is some problem with atof i have done one more test..
| int integer; |
| float flot; |
| uchar ascii_int[] = "12345"; |
| uchar ascii_float[] = "54321.54321"; | | integer = atoi(ascii_int); | | | printf("The integer value is %d\n\r", integer); | | | integer = atoi(ascii_float); | | | printf("The float value is %d\n\r", integer); |
|
The output follows,
The integer value is 12345
The flot value is 54321
So, The above test that i concluded atoi is working perfectly & there is some issue with atof...