4 Printing Program Arguments
Here's the contents of arguments.cminor that prints each
given program argument in its own line:
4.1 Running the Program
> cminor run assembly/debug/arguments.cminora foo bar
foo
bar
4.2 Possible Signatures of the Main Function
Here are possible signatures of the main function:
- If void return type is declared, the program implicitly returns exit code 0 to its caller.
- If int return type is declared, the main function must return an exit code explicitly
by using a return statement.
The reason for requiring int return-valued main function to explicitly return a value is that this way the programmer cannot accidentally forget to return a value.