2.3 Data Conversion

The data-conversion routines convert numbers to strings of ASCII characters and vice versa. These routines are implemented as functions, all of which are declared in the include file STDLIB.H. The atof function, which converts a string to a floating-point value, is also declared in MATH.H.

Routine Use

abs Finds absolute value of integer
atof Converts string to float
atoi Converts string to int
atol Converts string to long
_atold Converts string to long double
_ecvt Converts double to string
_fcvt Converts floating-point number to string
_gcvt Converts floating-point number to string and stores it in a buffer
_itoa Converts int to string
labs Finds absolute value of long integer
_ltoa Converts long to string
strtod Converts string to double
strtol Converts string to a long integer
_strtold Converts string to long double
strtoul Converts string to an unsigned long integer
_ultoa Converts unsigned long to string