Archive for the ‘Functions List’ Category


July 26th, 2010 c# No comments

Prototype: long atol(const char *string);
Header File: cstdlib or (stdlib.h for C)
Explanation: This function accepts a string and converts it into a long. For example, if “1234″ is passed into the function, it will return 1234. It is similar to atoi, except that it can handle larger numbers (up to the maximum size of a long). If the string contains a decimal place, the number will be truncated. Eg, “104.21″ will be returned as 104.


//Example reads in a string, and converts it to a long

using namespace std;

int main()
char a_char[10];
cout<<"As a long: "< }

Categories: Functions List, Resources Tags: