mallo(0)
2016-05-04 09:02
211 查看
#include <stdio.h> #include <stdlib.h> /* run this program using the console pauser or add your own getch, system("pause") or input loop */ int main(int argc, char *argv[]) { char* p; if((p=(char*)malloc(0))==NULL) { puts("got a NULL pointer!\n"); } else { //printf("%d\n",sizeof(p)/sizeof(char)); puts("got a valid pointer!\n"); } return 0; }
相关文章推荐
- Android Studio 快捷键总结(OS X)
- python中re模块的使用
- angularJS 开发原则之约定优先原则
- git cherry-pick后无权限git push的一个记录
- strtok()函数
- crazy pointer
- ArraySegment
- 名片设计尺寸及名片设计的注意事项
- jeecg快速开发平台-初学入门必备
- PHP实现获取并生成数据库字典的方法
- cache与主存的地址映射
- cache与主存的地址映射
- cache与主存的地址映射
- cache与主存的地址映射
- cache与主存的地址映射
- cache与主存的地址映射
- cache与主存的地址映射
- cache与主存的地址映射
- cache与主存的地址映射
- cache与主存的地址映射