#include <iostream>
using namespace std;
int main()
{
// Each time our program executes, it can be loaded into a
// different physical memory. Yet we want to apply addresses
// from the beginning of memory. The MEMORY variable represents
// the beginning of memory at location zero:
int MEMORY = 0;
// "HELLO" is stored in memory as a sequence of bytes.
// To keep track of that sequence of bytes, compiler
// uses memory location of the first byte:
int location = int( "HELLO" );
cout << "The location is " << location << '\n';
for(;;) {
cout << "Enter new location: ";
cin >> location;
// Show character at the specified location:
cout << MEMORY[ (char*)location ] << "\n";
// (char*) means "get a character from the specified location"
// We need (char*) because otherwise compiler doesn't know what
// type of object to retrieve from memory.
}
return 0;
}