Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ ltoa(3C) — HP-UX 7.01

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

printf(3C)

strtol(3C)

LTOSTR(3C)

NAME

ltostr, ultostr, ltoa, ultoa − convert long integers to strings

SYNOPSIS

char *ltostr (n, base)
long n;
int base;

char *ultostr (n, base)
unsigned long n;
int base;

char *ltoa (n)
long n;

char *ultoa (n)
unsigned long n;

DESCRIPTION

The functions ltostr and ultostr convert a signed or unsigned long integer to the corresponding string representation in the specified base.  The argument base must be between 2 and 36, inclusive. 

The functions ltoa and ultoa convert a signed or 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(3C) for simple conversions. 

WARNINGS

The return values point to static data whose content is overwritten by each call. 

ERRORS

If the value of base is not between 2 and 36, ltostr and ultostr return the value NULL and set the external variable errno to ERANGE. 

AUTHOR

Ltostr, ultostr, ltoa and ultoa were developed by HP. 

SEE ALSO

printf(3C), strtol(3C). 

Hewlett-Packard Company  —  HP-UX Release 7.0: Sept 1989

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026