Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ ltostr(3C) — HP-UX ANSI C A.09.00

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

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

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 sprintf(3C)).

ERRORS

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

WARNINGS

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

AUTHOR

ltostr(), ultostr(), ltoa(), and ultoa() were developed by HP. 

SEE ALSO

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

Hewlett-Packard Company  —  HP-UX Release 9.0: August 1992

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