g*****r 发帖数: 1037 | 1 这个题目有什么简洁的代码?
E.g. -123abc ==> -123
consider overflow | B*******1 发帖数: 2454 | 2 atoi
function
int atoi ( const char * str );
Convert string to integer
Parses the C string str interpreting its content as an integral number,
which is returned as an int value.
The function first discards as many whitespace characters as necessary until
the first non-whitespace character is found. Then, starting from this
character, takes an optional initial plus or minus sign followed by as many
numerical digits as possible, and interprets them as a numerical value. | g*****r 发帖数: 1037 | 3 what is the implementation code? | f*******t 发帖数: 7549 | 4 google atoi you can find 一大堆 code
【在 g*****r 的大作中提到】 : what is the implementation code?
|
|