1. 程式人生 > >atof函式(把字串轉換成浮點數)

atof函式(把字串轉換成浮點數)

            atof(字串)

1. 函式名: atof 功 能: 把字串轉換成浮點數 程式碼:
#include<bits/stdc++.h>
using namespace std;
int main()
{
    char a[4];
    a[0]='1';
    a[1]='2';
    cout<<atof(a)<<endl;
}