Mail Archives: djgpp/1996/11/15/22:43:14
Henrik Bäärnhielm wrote:
>
> Is there a library function that convert a long to a string? In for
> example Turbo C++ 3.0 which I have coded in pretty much, there are ultoa
> that converts unsigned long to string and gcvt that converts float to
> string. I have looked in the library reference but I can't find
> something that does that.
char str[100];
long l = 100;
sprintf( str, "%ld", l );
You could easily write an "ltoa()" function that does this and put it in
your programs. There is no such function in DJGPP because it is
non-ANSI.
P.S.: Since ints in DJGPP are 4-byte anyway, itoa() is easily capable
of handling a long.
--
John M. Aldrich <fighteer AT cs DOT com>
* Anything that happens, happens.
* Anything that, in happening, causes something else to happen,
causes something else to happen.
* Anything that, in happening, causes itself to happen again, happens
again.
* It doesn't necessarily do it in chronological order, though.
--- Douglas Adams
- Raw text -