6.5 Constants and Variables in Memory


6.5 Constants and Variables in Memory

System memory-where many programs are executed-can be thought of as little mailboxes. Each box has an address (an identifier) called a memory address, and data is stored inside this box. Consider Figure 6.1. The computer, then, at any point can reference data by its memory address since all addresses are unique.

image from book
Figure 6.1

Programs all use data, which can be variable or constant. Furthermore, data can be of different kinds according to its data type. This can be numerical, alphabetical, and others. Due to this variation, it makes sense that various forms of data require more memory than others. So some "mailboxes" need to be larger than others, but each "mailbox" can still be referenced by its address, regardless of size. In short, different data types have different memory requirements.




Introduction to Game Programming with C++
Introduction to Game Programming with C++ (Wordware Game Developers Library)
ISBN: 1598220322
EAN: 2147483647
Year: 2007
Pages: 225
Authors: Alan Thorn

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net