Reading value at an address

Posted by user146780 on Stack Overflow See other posts from Stack Overflow or by user146780
Published on 2010-03-25T21:27:17Z Indexed on 2010/03/25 21:33 UTC
Read the original article Hit count: 442

Filed under:

I'm trying to make a program that reads the value at a certain address. I have this:

int _tmain(int argc, _TCHAR* argv[])
{
    int *address;
    address =   (int*)0x00000021;
    cout << *address;
    return 0;
}

But this gives a read violation error. What am I doing wrong? Thanks

© Stack Overflow or respective owner

Related posts about c++