Book Image

Learning C++ by creating games with UE4

By : William Sherif
Book Image

Learning C++ by creating games with UE4

By: William Sherif

Overview of this book

Table of Contents (19 chapters)
Learning C++ by Creating Games with UE4
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
2
Variables and Memory
Index

Chapter 2. Variables and Memory

To write your C++ game program, you will need your computer to remember a lot of things. Things such as where in the world is the player, how many hit points he has, how much ammunition he has left, where the items are in the world, what power-ups they provide, and the letters that make up the player's screen name.

The computer that you have actually has a sort of electronic sketchpad inside it called memory, or RAM. Physically, computer memory is made out of silicon and it looks something similar to what is shown in the following screenshot:

Does this RAM look like a parking garage? Because that's the metaphor we're going to use

RAM is short for Random Access Memory. It is called random access because you can access any part of it at any time. If you still have some CDs lying around, they are an example of non-random access. CDs are meant to be read and played back in order. I still remember jumping tracks on Michael Jackson's Dangerous album way back when switching...