#include <iostream>
using namespace std;
int main()
{
long n = -2147483648;
n *= -1;
cout << n << endl;
}
[/cpp]
my output:
Code: Select all
-2147483648
Moderator: Board moderators
Code: Select all
-2147483648
Nope, C++ standards don't impose much on the size of int types.A1 wrote:sorry standard int type range is
-2^15 to 2^15-1 that is -32768 to 32767
But it is possible that your compiler support more range!
As a good programmer,Krzysztof Duleba wrote:Then your understanding of "general" is very special. Only some out-of-date compilers, like old Borlands, have sizeof(int) = 2.