![]() On other systems (Windows 3.1, the Mac), however, the system is not aware of what you are doing. On a system with protected memory spaces (UNIX, Windows 98/NT), this sort of statement will cause the system to terminate execution of the program. In other words, you are writing into memory that your program does not own. The location s is more than likely outside of your program's memory space. You might make the following global declaration in a program: For example, a floating point variable consumes 4 contiguous bytes in memory. It can also group bytes together as it needs to to form larger variables, arrays, and structures. The computer can access any address in memory at any time (hence the name "random access memory"). Memory addresses act just like the indexes of a normal array. ![]() In this array, every memory location has its own address - the address of the first byte is 0, followed by 1, 2, 3, and so on. Memory can be thought of simply as an array of bytes. RAM holds the programs that your computer is currently running along with the data they are currently manipulating (their variables and data structures). For example, your computer might have 16 or 32 or 64 megabytes of RAM installed right now. If you have not read it already, now would be a good time to read How Bits and Bytes Work to fully understand bits, bytes and words.Īll computers have memory, also known as RAM ( random access memory). The previous discussion becomes a little clearer if you understand how memory addresses work in a computer's hardware.
0 Comments
Leave a Reply. |