[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 .
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); }
相关文章推荐
- C语言中简单的for循环和浮点型变量
- 求一个字符串中最长的字符串
- More Effective C++ 条款35 让自己习惯于标准C++ 语言
- 【c语言】 小游戏——猜字游戏
- C++ 不改变链表结构 逆序打印
- C++:操作符
- [c++]使用前后缀表示常量的类型
- C++文件操作
- 【LeetCode从零单刷】Balanced Binary Tree
- C++基础编程----3.2多维数组
- More Effective C++ 条款34 如何在一个程序中结合C++和C
- C语言书写规范
- C++ 深拷贝与浅拷贝
- 【LeetCode从零单刷】Find Peak Element
- C++ 头文件cstring,string.h,string 三者的区别
- ARM裸机程序开发(十):C语言环境初始化
- 关于c语言中的字符数组的输入问题
- C语言第一课练习
- C语言第二课练习
- C语言 unsigned 和 signed 类型相互转换深入理解