Role:
Converts a string to decimal by using the function strtoul (const char *, char * *, int) in the corresponding binary format
char* p;//Position string conversion termination
unsigned long s = Strtoul ("FFt6", &p,);
NSLog (@ "%lu", s);
NSLog (@ "%c", *p);
Explain:
The first parameter is the target string that needs to be converted, the second parameter is the position that is terminated during the conversion, the
third parameter is the feed corresponding to the target string, and the 0 indicates automatic detection of the conversion format,
example: The above code ' FFT6 ' is the target string, FF is 16, The third parameter is set to 16.
Execution results:
2016-03-22 17:44:52.557 demoo[12381:434989] 255
2016-03-22 17:44:52.557 demoo[12381:434989] t
The third parameter in the execution result is the first character that cannot be converted: ' t ', and hexadecimal ' FF ' corresponds to the decimal;
Top: This method is typically used to convert other strings into decimal numbers.