Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Zortech C++ 3.0r4 - <b>ltoa</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
ltoa

Usage

   #include <stdlib.h>
   char *ltoa(long number,char *string,int radix);

Description

   The ltoa() function converts a long integer into a null terminated string
   using a radix. The radix specifies the base and must be in the range 2
   through 36, using the numbers 0 to 9 and letters A to Z for the digits 0

   through 35. Attempts to use any other number base will cause ltoa() to
   ignore the number base argument and convert to decimal. Also note that
   all conversions for bases other than 10 are unsigned. The arguments are:

       number  the number to convert

       string  the buffer in which to build the string

       radix   the number base to use (range: 2 through 36)

Example 

   #include <stdio.h>
   #include <stdlib>

   int main()
   {
       char numbuf[20];

       puts(ltoa(123456L,numbuf,10)); /* prints 123456   */

       puts(ltoa(-1L,numbuf,0));      /* prints -1       */
       puts(ltoa(-1L,numbuf,16));     /* prints FFFFFFFF */
       return EXIT_SUCCESS;
   }

Return Value

   A pointer to the converted string

See Also

   itoa



See Also: itoa

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson