Update README.md
This commit is contained in:
parent
175fcc7978
commit
9218a3fd4c
|
@ -5,7 +5,7 @@
|
||||||
In this exercise we will look together at what happens when we change a reference
|
In this exercise we will look together at what happens when we change a reference
|
||||||
parameter to a value or a const reference.
|
parameter to a value or a const reference.
|
||||||
|
|
||||||
Let's look at this function
|
Let's look at this function in [`Game.cpp`](../../../lib/Game.cpp)
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
void Game::processEvents(InputState & inputState) {
|
void Game::processEvents(InputState & inputState) {
|
||||||
|
@ -28,6 +28,8 @@ void Game::processEvents(InputState & inputState) {
|
||||||
|
|
||||||
## Exercise
|
## Exercise
|
||||||
|
|
||||||
|
You can follow along locally:
|
||||||
|
|
||||||
1. Make `inputState` a value. What happens when you compile the code? Can you explain why?
|
1. Make `inputState` a value. What happens when you compile the code? Can you explain why?
|
||||||
|
|
||||||
2. Now make it a `const` reference. What happens? Can you explain why?
|
2. Now make it a `const` reference. What happens? Can you explain why?
|
||||||
|
|
Loading…
Reference in New Issue