代码如下
#include <stdio.h>
int main()
{
int *p;
p = NULL;
printf("p=0x%x\n",p);
typedef struct node {
int data;
int * next;
} * Lnode;
Lnode q;
q = NULL;
printf("q=0x%x\n", q);
printf("q->data=0x%x,q->next=0x%x\n", q->data, q->next);
//printf("NULL->next=%x\n", NULL->next); //对NULL取域值导致语法错误
return 0;
}
运行结果(运行环境:VS2015社区版本)
.
原文:http://www.cnblogs.com/yang666/p/5947495.html