- What is #include doing?
#include is bringing in a ‘glob’ of code called ‘iostream’ from somewhere else
- Why do we have the main function in our file?
This is so that when the file is executed, we can direct the computer (and/or compiler?) to know what to do first upon execution.
- What are the Expression Statements doing in terms of our Gameplay?
The Expression Statements are Leveraging ‘cout’ functionality (contained in whatever ‘std’ is) to print text to the screen
In the first expression ‘block’ we are introducing the player to the game world and prompting them to enter a code.
In the second expression ‘block’, we are simply displaying the sum and product variables we created in the Declaration Statements.
- What are the Declaration Statements doing in terms of our Gameplay?
The Declaration Statements are creating variables and setting them to their initial values
In this case, the variables are being declared as ‘const’ (Constant) variables, which means we can’t alter them after declaration.
In gameplay terms, we’re setting three numerical values (a, b, c) and also setting the sum and product of those variables as the ‘sum’ and ‘product’ variables
- Why do we have the return statement in our main function?
I think it is required to return something from any function.
I’m not exactly sure why we return 0, maybe it is an accepted standard to return 0 if we don’t need to return anything from a function.