Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ () — Coherent 3.1.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought


atol()                   General Function                  atol()




Convert ASCII strings to long integers

long atol(string) char *string;

atol converts the argument string to a binary representation of a
long.  string  may contain a leading sign  (but no trailing sign)
and any  number of decimal  digits.  atol ignores  leading blanks
and tabs;  it stops scanning  when it encounters  any non-numeral
other than the leading sign, and returns the resulting long.

***** Example *****



main()
{
        extern char *gets();
        extern long atol();
        char string[64];



        for(;;) {
                printf("Enter numeric string: ");
                if(gets(string))
                        printf("%ld\n", atol(string));
                else
                        break;
        }
}


***** See Also *****

atof(), atoi(), float, long, printf(), scanf()

***** Notes *****

No  overflow  checks  are performed.   atol  returns  zero if  it
receives a string it cannot interpret.
















COHERENT Lexicon                                           Page 1


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