Explaining anatomy of code from lesson 20 in unreal engine

Hi everyone! I was told to come here and share what in my own words what I think each piece of my TripleX program is doing. :slight_smile: This is what I think each piece of the program does based on my current knowledge :smiley:

The Preprocessor Directive includes code written by another programmer that enable us to use the standard namespace in our program! without it we wouldn’t be able to output text to the terminal.

The Main Function is a requirement of any program, without it the code won’t even compile! It includes our main code that will be executed throughout the program and the main meat and potatoes of the program will be found in there.

Expression Statements are statements in the code that are telling the program to express something. They fill in text for our user to read in the terminal and can also let the program know to start on a new line.

Declaration Statements are statements declaring variables and formulas in our program. They aren’t things that the end user can see and run in the background. They can do lots of algebraic functions and are useful for calculating things.

The return statement is also a requirement of any program. When the code reaches that line and it returns a 0 that tells the computer that the code was executed successfully and without any errors.

1 Like

Everything looks good! Awesome job!

1 Like