You can specify a long integer that is longer than a long
as long long
.
But what would it mean to specify an integer that is more integer than int
?
More precisely. In C++ you have type int
, which is normally a 32-bit wide integer. You then have the modifiers short
and long
that can be used as illustrated by the following example:
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
cout << "short int: " << sizeof(short int) << endl;
cout << "short: " << sizeof(short) << endl;
cout << "int: " << sizeof(int) << endl;
cout << "long int: " << sizeof(long int) << endl;
cout << "long: " << sizeof(long) << endl;
cout << "long long int: " << sizeof(long long int) << endl;
cout << "long long: " << sizeof(long long) << endl;
}
On my Linux box, running g++ 4.7.2
, this gives:
short int: 2
short: 2
int: 4
long int: 8
long: 8
long long int: 8
long long: 8
So:
int
is a 32-bit signed integer
short int
(abbreviated, short
) is a 16-bit signed integer
long int
(abbreviated, long
) is a 64-bit signed integer
long long int
(abbreviated, long long
) is still a 64-bit signed integer on my architecture / compiler, but it is in the language to allow a longer integer type (e.g. 128 bit) on different architectures / compilers.
So, as Will has explained: in this context, long
is a modifier that can be applied twice whereas int
is not a modifier.