This documentation is archived and is not being maintained.

_ltoa, _ltow

Convert a long integer to a string.

char *_ltoa(
   long value,
   char *string,
   int radix 
wchar_t *_ltow(
   long value,
   wchar_t *string,
   int radix 


Number to be converted.
String result.
Base of value.

Return Value

Each of these functions returns a pointer to string. There is no error return.


The _ltoa function converts the digits of value to a null-terminated character string and stores the result (up to 33 bytes) in string. The radix argument specifies the base of value, which must be in the range 2 – 36. If radix equals 10 and value is negative, the first character of the stored string is the minus sign (–). _ltow is a wide-character version of _ltoa; the second argument and return value of _ltow are wide-character strings. Each of these functions is Microsoft-specific.

Generic-Text Routine Mappings

TCHAR.H routine _UNICODE & _MBCS not defined _MBCS defined _UNICODE defined
_ltot _ltoa _ltoa _ltow


Routine Required header Compatibility
_ltoa <stdlib.h> Win 98, Win Me, Win NT, Win 2000, Win XP
_ltow <stdlib.h> Win 98, Win Me, Win NT, Win 2000, Win XP

For additional compatibility information, see Compatibility in the Introduction.


All versions of the C run-time libraries.


See the example for _itoa.

See Also

Data Conversion Routines | _itoa | _ultoa | Run-Time Routines and .NET Framework Equivalents