Here are a few questions to help you clarify your understanding of the main program.
#include every library that you wish to use.
Place a using directive for the std namespace after the
#includes and before you use any library identifiers:
using namespace std;
The first statement after main's open curly brace:
int main(void)
{
-->
It's okay for main to return an int because it goes back
to the operating system (OS). The OS, after all, makes the final
decision as to what size int will be: 16 or 32 bits. Since the
OS makes this call, the int main returns will always be
the right size.
It also doesn't hurt that we almost never need to return values
other than 0. Most of the time our return value is in the
range [0..255].
It says that the main function doesn't require any inputs
(arguments) before beginning execution. (It may, of course, begin
execution by requesting inputs from the user via a cout/cin
combination...*shrug*)
return 0;
What is the meaning of that 0? (And, yes, the
0 you just mentioned
DOES have significance!)
The 0 represents that we experienced no errors
while executing. No problems. No trouble. No issues.