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 ...
Get C++: A Dialog Programming with the C++ Standard Library now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.