機能 |
文字列をdouble型の表現に変換する。 ※ エラー発生時の動作以外はstrtod(nptr, (char**)NULL)と等価 |
||
---|---|---|---|
定義 |
#include <stdlib.h> double atof ( const char * nptr ); |
||
引数 |
|
||
戻り値 | 変換された値を返す。 | ||
実装例 |
#include <stdlib.h> #include <stdio.h> int main(void) { double f; f = atof("123.45"); printf("%f\n", f); return 0; } |
||
実行結果 |
123.450000 |
atof()