Hi guys,
Thank you for all your support.. Today i fixed the bug.. When it was not working i have included only #include <string.h>.
Now i have included #include <stdlib.h> too.. Now the following code working perfectly with atof feature..
int integer; | |||||||||||||
double flot; | |||||||||||||
uchar ascii_int[] = "12345"; | |||||||||||||
uchar ascii_float[] = "54321.54321";
|
The output follows,
The integer value is 12345
The flot value is 54321.54321
The one more change required to make it work atof was type casting..
Hi guys,
Thank you for all your support.. Today i fixed the bug.. When it was not working i have included only #include <string.h>.
Now i have included #include <stdlib.h> too.. Now the following code working perfectly with atof feature..
int integer; | |||||||||||||
double flot; | |||||||||||||
uchar ascii_int[] = "12345"; | |||||||||||||
uchar ascii_float[] = "54321.54321";
|
The output follows,
The integer value is 12345
The flot value is 54321.54321
The one more change required to make it work atof was type casting..
Finally u got it working , I told you so
Best Regards
Deepak Kumar Rana
Field Application Engineer
H.P: +91 9916927803
Freescale Semiconductors
Campus 1C ,4th Floor Ecospace
Sarjapur Outer Ring Road
Banglore India 560037
Hello kandha samy,
any code for sharing? How do you invoke atoi and how atof? How does atof fail?
Please read a following post which explains what you should include in your bug/problem report:
How to post in the MQX section and get an answer!
Regards,
c0170
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";
|
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";
|
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...
Hi
In the properties of the project in the Librarian you need to choose the MOdel C9xx
Print format int_FP
In the MQX BSP you need to enable
#define MQX_INCLUDE_FLOATING_POINT_IO 1
This should solve the problem in MQX system