M
Mark Bruno
When I declare a 64 bit integer (long long or __int64), it seems to have the
same boundaries as a 32 bit int while using printf, but the correct 64 bit
boundaries when using cout. Here's my code:
#include <cstdio>
#include <iostream>
using namespace std;
int main()
{
long long a = 2147483647; //The max value for a signed 32 bit int
long long b = 9223372036854775807; //The max value for a signed 64 bit int
printf("%d %d %d\n", a, a+1, b);
cout << a << " " << a+1 << " " << b << endl;
return 0;
}
same boundaries as a 32 bit int while using printf, but the correct 64 bit
boundaries when using cout. Here's my code:
#include <cstdio>
#include <iostream>
using namespace std;
int main()
{
long long a = 2147483647; //The max value for a signed 32 bit int
long long b = 9223372036854775807; //The max value for a signed 64 bit int
printf("%d %d %d\n", a, a+1, b);
cout << a << " " << a+1 << " " << b << endl;
return 0;
}