[問題] 新手問題關於字串轉浮點數
問題是這樣的
我將0.45這個數字放在.txt檔裡
然後用substr()讀入成字串型態
接著我想做運算
就只是 1 - 0.45 而已
我試了atof()有錯:
'atof' : cannot convert parameter 1 from 'class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> >' to 'const char
想請各位幫幫忙
謝謝
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 210.66.134.94
→
05/10 21:16, , 1F
05/10 21:16, 1F
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章