![]() |
VOOZH | about |
The strtoul() function in C/C++ which converts the initial part of the string in str to an unsigned long int value according to the given base, which must be between 2 and 36 inclusive, or be the special value 0. This function discard any white space characters until the first non-whitespace character is found, then takes as many characters as possible to form a valid base-n unsigned integer number representation and converts them to an integer value.
Syntax:
unsigned long int strtoul(const char *str, char **end, int base)
Parameter: The function accepts three mandatory parameters which are described below:
Return value: The function returns two value as below:
Below programs illustrate the above function:
Program 1:
The unsigned long integer is : 15124320 String in str is : Geeks For Geeks
Program 2:
The unsigned long integer is : 12345 String in str is : GFG The unsigned long integer is : 24677 String in str is : GFG The unsigned long integer is : 866825 String in str is : GFG