With std::cout, it prints positiveby qbguy (no login)#include <iostream> int main () { std :: cout << -2147483648 << std :: endl; return 0; } Supposedly, this is correct behavior in ISO C and C++ according to http://gcc.gnu.org/onlinedocs/gcc/Incompatibilities.html On a 64-bit system, it might print it as negative because on a 64-bit system, an int would be 64-bits (?) Supposedly, in C99, -2147483648 is negative, because 2147483648 has type 'long long'. from IP address 76.195.133.68 |
| Response Title | Author and Date |
| gcc defaults to C89, and C++98 isn't any better regarding this aspect. | rpgfan3233 on Apr 7 |