HP-UX Reference (11i v1 00/12) - 3 Library Functions A-M (vol 6)
__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man3/!!!intro.3c
________________________________________________________________
___ ___
l
ltostr(3C) ltostr(3C)
NAME
ltostr(), ultostr(), ltoa(), ultoa() - convert long integers to strings
SYNOPSIS
#include <stdlib.h>
char *ltostr(long n, int base);
char *ultostr(unsigned long n, int base);
char *ltoa(long n);
char *ultoa(unsigned long n);
Obsolescent Interfaces
int ltostr_r(long n, int base, char *buffer, int buflen);
int ultostr_r(unsigned long n, int base, char *buffer, int buflen);
int ltoa_r(long n, char *buffer, int buflen);
int ultoa_r(unsigned long n, char *buffer, int buflen);
DESCRIPTION
ltostr() Convert a signed long integer to the corresponding string representation in the
specified base. The argument base must be between 2 and 36, inclusive.
ultostr() Convert an unsigned long integer to the corresponding string representation in the
specified base. The argument base must be between 2 and 36, inclusive.
ltoa() Convert a signed long integer to the corresponding base 10 string representation,
returning a pointer to the result.
ultoa() Convert an unsigned long integer to the corresponding base 10 string representation,
returning a pointer to the result.
These functions are smaller and faster than using sprintf() for simple conversions (see printf(3S)).
Obsolescent Interfaces
ltostr_r(), ultostr_r() , ltoa_r(), ultoa_r() convert long integers to strings.
APPLICATION USAGE
ltostr(), ultostr(), ltoa() and ultoa() are thread-safe. These interfaces are not async-
cancel-safe.
ERRORS
If the value of base is not between 2 and 36, ltostr() and ultostr() return NULL and set the exter-
nal variable errno to ERANGE.
WARNINGS
The return values for ltostr(), ultostr(), ltoa() and ultoa() point to data whose content is
overwritten by subsequent calls to these functions by the same thread.
ltostr_r(), ultostr_r() , ltoa_r() and ultoa_r() are obsolescent interface supported only
for compatibility with existing DCE applications. New multi-threaded applications should use
ltostr(),
ultostr(), ltoa() and ultoa().
AUTHOR
ltostr(), ultostr(), ltoa(), and ultoa() were developed by HP.
SEE ALSO
strtol(3C), printf(3S).
Section 3−−506 − 1 − HP-UX Release 11i: December 2000
___
___