Hi,
can anyone tell me how to access a specific memory location in C++ (I use Dev-C++ 4.9.9.2) without the OS giving me an error and stopping the execution of my prog? I've tried the following code on both WinXP and Win98, but they both gave me an error :
#include<iostream>
#include<conio.h>
int main()
{
using namespace std;
int *p;
p = (int *) 0x378; //0x378 is the memory location I'm trying to access
//If I enter 'cout<<p<<endl;', prog executes and outputs '0x378'
//But if I dereference the pointer, 'cout<<*p<<endl;', the OS gives me an error
}
I've also tried a couple of different addresses, but the results are the same...
Thanks