#include <cstdlib> double atof( const char *str );
atof() 函式將 str 轉換為 double 型別,然後返回該值。str 必須以一個有效的數字開頭,但可以以任何非數字字元結尾,除了“E”或“e”。例如,
x = atof( "42.0is_the_answer" );
會導致 x 被設定為 42.0。