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