[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Re: itoa

Rahul Jindal forced the electrons to say:
> to my utter surprise, i found that gnu c++ does not have a itoa function
> even when it has an atoi.

There is no itoa() in ANSI C or POSIX either. Use sprintf(3) (or better,
snprintf(3)) instead.


int n = 50;
char s[3];
snprintf (s, sizeof s, "%d", n);