It depends on the computer, and operating system.
Use the sizeof( ) keyword, to find the size of an int.
a char is usually 1 byte
a short is usually 2 bytes
a long is usually 4 bytes.
an int can be 2 or 4 bytes, it is usually 4 on newer machines/os'es
Code:
#include <iostream>
using namespace std;
int main()
{
cout << "Size of char is " << sizeof(char) << endl;
cout << "Size of short is " << sizeof(short) << endl;
cout << "Size of long is " << sizeof(long) << endl;
cout << "Size of int is " << sizeof(int) << endl;
cout << "Size of float is " << sizeof(float) << endl;
cout << "Size of double is " << sizeof(double) << endl;
return 0;
}
Gave me this output
Size of char is 1
Size of short is 2
Size of long is 4
Size of int is 4
Size of float is 4
Size of double is 8