The main() function
When we took up C++ in school, or maybe at university, on our first C++ course, we were told by our teacher: “Dear fellows, here’s the main function: void main(void)
. That’s where your program will start.” That’s it.
Chapter done – turn the pages and see you in the next one.
However, this statement isn’t true. I wrote void main(void)
just to wake your curiosity and put you in a state of alertness. At this point in their career, all C++ programmers should know that void main(void)
is as far as standard C++ as Point Nemo is from the closest piece of dry land.
Oh – you’re still here! This means that you must have read the fine print. Excellent – we programmers should always pay attention to the finer details, such as how our application is loaded and executed in memory by the underlying operating system.
Since we live in a free world, we have the option to choose from several operating...