ltoa

Converts a long integer to a string.

Library:LibC
Classification:Other
Service:General C Services

Syntax

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

Parameters

value

(IN) Specifies the integer value to be converted.

buffer

(OUT) Points to the character array, which can have a maximum size of 33 bytes.

radix

(IN) Specifies the base to be used when converting the integer. It must be in the range from 2 - 36.

Return Values

Returns a pointer to the result.

Remarks

The ltoa function converts the integer value into the equivalent string in base radix notation, storing the result in the character array pointed to by buffer. The string is null terminated. If the value of radix is 10 and value is negative, the first character stored in the string is a minus sign (-).

See Also

atol