Go Back   Computer Forums > General Computing > Programming
Join Computer forums Today

Thread Tools Search this Thread Display Modes
Old 03-16-2005, 08:51 AM   #1
Beta Member
Join Date: Mar 2005
Posts: 1
Default Accessing a specific memory address

I am attempting to read and write to a specific memory location. My first attempt was as follows:

int main(int argc, char *argv[]) {
int *num1;
void *p;
p = reinterpret_cast< void* > (0x04e27e74);
num1 = (int*)p;
printf("0x4e27e74=0x%x\n", *num1);
return 0;

but every time I run the code to see what is in the memory location I get an access violation exception. I though of using MK_FP, but I do not know what the segment address of this memory address is or how to figure it out.

Basically the above code segment is what I want to do, except I also want to write to the specific location, but it does not work. All sugestions are welcomed.

madtown54 is offline   Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

All times are GMT -5. The time now is 02:33 PM.

Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2016, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0