c++ length of int

The size of an int in C++ is implementation-dependent. It is not always guaranteed to be 4 bytes, but it is at least 2 bytes. You can use the sizeof operator to find the size of an int in your particular implementation of C++.