[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
", k);
}

原文地址:https://www.cnblogs.com/tianhangzhang/p/4879021.html