Jump to content

atol (programming)

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Deryck Chan (talk | contribs) at 14:05, 9 February 2006 (usage). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.


The atol function in C programming language and C++ converts a string of a numerical representation into a long integer. When used, the function is included from the stdlib.h library.

The atol function has a prototype as follows:

long atol (const char *string)

Where string is the string, represented by an array of characters, terminated or intercepted by any non-numerical character, to be converted to the integer. The required integer is returned.