トップページ > キーワード検索 > atof()
C言語規格
C言語(その他)
プログラム
その他
atof()
機能 文字列をdouble型の表現に変換する。
※ エラー発生時の動作以外はstrtod(nptr, (char**)NULL)と等価
定義 #include <stdlib.h>

double atof ( const char * nptr );
引数
nptr変換する文字列
戻り値 変換された値を返す。
実装例
#include <stdlib.h>
#include <stdio.h>

int main(void)
{
    double f;
    
    f = atof("123.45");
    
    printf("%f\n", f);
    
    return 0;
}
実行結果
123.450000





inserted by FC2 system