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

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);
}

posted @ 2015-10-14 22:06  Jonas0608  阅读(373)  评论(0编辑  收藏  举报