Function Return Values
Jun 29, 2022
We are going to learn how to get outputs out of functions in C++. This will help us simplify our code and implement our pseudo code.
- Expression — Fragment of code that produces a value
- Statement — An action to be performed
An expression is almost always a statement.
A statement does not always give a value.
Expressions = MyVector, LocalVector.Z, LocalVector.Z + 100, GetActorLocation().
We are going to get our current location.
We took our current location of our actor and added 1 to it each frame. We are then saying that our setting our new location each from +1 in the X direction.
Now we have an idea how return values work out of functions.