<<< The BCPL language | Index | C/C++ memory access demo v.3 >>> |
#include <iostream>
using namespace std;
int main()
{
int MEMORY = 0;
//int location = int( "HELLO" ); // BEFORE
char* location = "HELLO"; // NOW
for(;;) {
// Temporarily commented out
// cout << "Enter new location: ";
// cin >> location;
// Show character at the specified location:
//cout << MEMORY[ (char*)location ] << "\n"; // BEFORE
cout << MEMORY[ location ] << "\n"; // NOW
break;
}
return 0;
}
<<< The BCPL language | Index | C/C++ memory access demo v.3 >>> |