-
Funkce
-
Converts a string to an integer value.
-
Zápis
-
int strtol(string s);
-
Returns
-
The strtol function returns the numerical representation
of the given string as an int value. Conversion ends at the
first character that does not fit into the format of an
integer constant.
If an error occurs during conversion of the string 0
will be returned.
Viz také strtod
Příklad
string s = "1234";
int i = strtol(s);
printf("The value is %d\n", i);