The integer type uses all its memory - typically 32 or 64 bits - to cover the largest possible range of distinct integer values it can. It doesn't keep track of any formatting/display information. Consequently, even a 32-bit value can track some 4 billion distinct values, but however they're to be shown on-screen, in files etc. has to be decided by the surrounding code, and is not a property of the integer itself. So, if you have an integer, you can choose the formatting when you display it. There are a variety of ways to do this. The most C++ way is using std::ostream and the <iomanip> header, which includes support for specifying a field width and fill/padding character. For an example, see http://www.cplusplus.com/reference/iostream/manipulators/setw/ and you can follow the "See also" link to setfill. The way inherited from C is...

printf("%02d", n);

...where the first double-quoted string section contains a "format string", in which % introduces a conversion, 0 means to pad and 2 is the width, d means the next decimal/integer value in the list of arguments.