int main()
The next construct we have to examine is the line int main(), which has two new components. The first is the “return type”, which specifies the type of value that will be returned from the program when it ends. In this case, that type is int, which is an integral type exactly like short, except that its size depends on the compiler that you're using.[25] With the 32-bit compiler on the CD in this book, an int is 32 bits, or twice the size of a short. With a 16-bit compiler such as Borland C++ version 3.1, an int is the same size as a short, whereas on a 64-bit compiler an int would be 64 bits in length. I don't like to use ints where a short will do, because I want to minimize the changes in behavior of my code with compilers that ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access