[問題] C++ 不支援 %lf ?

看板C_and_CPP作者 (sjgau)時間12年前 (2012/05/29 13:35), 編輯推噓5(502)
留言7則, 7人參與, 最新討論串1/1
cc1plus: warnings being treated as errors In function 'int main(int, char**)': Line 26: warning: ISO C++ does not support the '%lf' printf format Line 26: warning: ISO C++ does not support the '%lf' printf format 要如何 更正,才能 消除上面的 warning? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 42.72.64.151

05/29 13:48, , 1F
%f
05/29 13:48, 1F

05/29 17:06, , 2F
這應該是C的事情...
05/29 17:06, 2F

05/29 21:25, , 3F
C++不是都用cout了嗎?
05/29 21:25, 3F

05/30 12:28, , 4F
include cstdio ? (不懂亂答)
05/30 12:28, 4F

05/30 22:16, , 5F
%f
05/30 22:16, 5F

05/30 23:46, , 6F
printf時用%f就可以了, scanf時才用%lf....@_@"
05/30 23:46, 6F

05/31 04:03, , 7F
樓上正解
05/31 04:03, 7F
文章代碼(AID): #1Fn60pX6 (C_and_CPP)