您的位置:首页 > 编程语言 > C语言/C++

[C++] Memory Retrieval(内存检索)

2015-10-14 22:06 381 查看
Traverse the memory by (char*) , because every time it will increase by 1byte


when i want get the int value , i need convert (char*) to (int*) , after that ,

it will get the value from continuous 4 bytes .

void *p = (void*)0x00C5FBF8;
void *q = (void*)0x00C5FFFF;

for (char* c = (char*)p; c != q ; c++)
{
  int k = *((int*)c);
  printf("%d\n", k);
}


内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: