您的位置:首页 > 其它

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