#include <iostream> int main() { int i = 5000000000; long l = 5000000000; long long ll = 5000000000; std::cout << 5000000000 << "\n" // <- no overflow << i << "\n" // overflow << l << "\n" // might overflow << ll << std::endl;}
Standard input is empty
prog.cpp: In function 'int main()': prog.cpp:4:12: warning: overflow in implicit constant conversion prog.cpp:5:12: warning: overflow in implicit constant conversion
5000000000 705032704 705032704 5000000000
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!