where is the "extras.h" library for using itoa()-function

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

where is the "extras.h" library for using itoa()-function

9,762 Views
cimbom
Contributor I
Hi,

when I try to include "extras.h", I get the error message
Error: the file "extras.h" cannot be opend

I want to use the itoa() function, I can't find this function in the "strings.h" library. In the help  is written
#include <extras.h>
char * itoa(int val, char *str, int radix);
char * _itoa(int val, char *str, int radix);
I can't compile my code because there is no "extras.h"

Please help...


CodeWarrior Development Studio for DSC56800/E version 8.1.1a, build 7168.

IDE Version: 5.6.1.1658
Labels (1)
Tags (1)
0 Kudos
Reply
9 Replies

1,425 Views
cimbom
Contributor I
I can't find any informations

0 Kudos
Reply

1,425 Views
J2MEJediMaster
Specialist I
The following FAQ on the Freescale web site, FAQ-27705, provides C source code for a simple binary to ASCII conversion function. HTH.

---Tom
0 Kudos
Reply

1,425 Views
cimbom
Contributor I
I know there are other ways to solve the problem but it would be much easyer to own the "extras.h" library. I know I will need it in the future much more :smileyhappy:
0 Kudos
Reply

1,425 Views
cimbom
Contributor I
is it possible to download the "extras.h" library from somewhere?
0 Kudos
Reply

1,425 Views
trytohelp
NXP Employee
NXP Employee
Hi,
 
On Freescale Web site this file is not available.
May be you can find some info on the web.
 
Pascal
0 Kudos
Reply

1,425 Views
trytohelp
NXP Employee
NXP Employee
Hi,
 
Extras.h is not include in the DSC libraries.
Attached to this post you will find a doc showing the  MSL Compatibility.
Major functions of Extras.h are included in MACos and Windows only.
For Windows it's CodeWarrior for Windows desktop version not embedded.
 
The MSL_C_Reference.pdf manual is the same for all products (desktop and embedded)
In the description of the Itoa function there is the remark:
This function may not be implemented on all platforms.
 
Please have a look to the doc attached.
 
Regards
Pascal
0 Kudos
Reply

1,425 Views
CompilerGuru
NXP Employee
NXP Employee
Not sure about the extras.h in CF, but note that neither itoa, _itoa or extras.h are part of the ANSI C standard.
Therefore it might be beneficial for portability to use a small internal integer to string conversion routine anyway.

Daniel
0 Kudos
Reply

1,425 Views
Lundin
Senior Contributor IV
Actually, there is a itoa function in my version of CW (for HCS12), but it is located in stdlib.h, even though it is indeed not a standard function. Compiler manufacturers like to clutter down stdlib.h with non-standard functions, for some reason.

Though, I completely agree that one should make one's own int to ASCII routine. It will make the code portable and likely more efficient. Creating one should not be a difficult task for the average beginner programmer.
0 Kudos
Reply

1,425 Views
FTSolutions
Contributor III
While I agree with the points that you make, if a routine is documented as being provided by the manufacturer and in the online help for that product, it should be included with the product.  Otherwise it is a defect.
0 Kudos
Reply