Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

_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 
);

Parameters

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

Return Value

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

Remarks

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

Requirements

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.

Libraries

All versions of the C run-time libraries.

Example

See the example for _itoa.

See Also

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

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.