rayw <> wrote:
> I'm pretty new to C, although I did do some years ago now.
>
> I've been told that itoa is no longer a standard function, and that the
> ato... functions - although in the std - are not recommended.
itoa has *never* been a standard function, and the atoi family of fuctions
are indeed not recommended to use.
>
> So, I was wondering what was wrong with both itoa and atoi etc (and what's
> replaced them).
What is wrong with itoa is primarily that it is not standardized and therefore
completely unportable. The problem with atoi (etc.) is that you can't do
proper error checking if the number that is converted doesn't fit in the
desired type.
To convert strings to integers use strtol (etc.) instead, and to create a
string representation of an integer us sprintf.
--
<Insert your favourite quote here.>
Erik Trulsson