1. 程式人生 > >8、 String to Integer (atoi)

8、 String to Integer (atoi)

ide resp you str lease 字符串 yourself please side

Implement atoi to convert a string to an integer.

Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input cases.

Notes: It is intended for this problem to be specified vaguely (ie, no given input specs). You are responsible to gather all the input requirements up front.

atoi是將字符串轉化為整形數的一個函數:char *str = "12345.67"; n = atoi(str); n=12345。

先放著。不想做

8、 String to Integer (atoi)