3 ms·
Well, it's an array of bytes with holes in it, because of the address map. Worse, the holes may change size as the OS allocates more memory as the program runs
by AnimalMuppet 3y ago
Well, it's an array of bytes with holes in it, because of the address map. Worse, the holes may change size as the OS allocates more memory as the program runs. So in that sense, no, it's not a huge array of bytes, and access to some addresses will segfault.
But C lets you treat memory like a huge array of bytes. You can do things like:
char *p = (char*)0;
char value = p[address];
This will segfault if you touch the wrong address. Other than that minor detail, you can think of memory as a huge array of bytes.