C語言中strtod與strtol的區別

strtod與strtol都是C/C++中常用的將字符數組轉換成數組型常用的函數,但是它們也有一定的區別(C++真是讓人又愛又恨)。 strtod用法 定義:double strtod (const char* nptr, char** endptr); 參數:nptr爲待轉換的字符數組,endptr爲不符合條件而終止nptr中的字符指針; strtol用法 定義:long strtol (con
相關文章
相關標籤/搜索