Why does (int)55 == 54 in C++?

前端 未结 8 1275
旧巷少年郎
旧巷少年郎 2020-12-31 01:32

So I\'m learning C++. I\'ve got my \"C++ Programming Language\" and \"Effective C++\" out and I\'m running through Project Euler. Problem 1...dunzo. Problem 2...not so mu

8条回答
  •  醉酒成梦
    2020-12-31 02:10

    Break the code for generatring, at times float number dont behave the way we think when used in a long expression...break the code and check it.

提交回复
热议问题