为什么p一进入循环就变成无效的指针了
#include <stdio.h>
#include <stdlib.h>
typedef struct weapon
{
char name;
int money;
struct weapon *next;
}lianbiao;
int main(void)
{
lianbiao a,b,c,*head;
lianbiao *p;
a.name = '1';
a.money = 1;
b.name = '2';
b.money = 2;
c.name = '3';
c.money = 3;
head = &a;
a.next = &b;
b.next = &c;
c.next = NULL;
p = head;
while(p!=NULL)//在这里就变成了无效的指针在之前p还正常
{
printf("%s,%d\n",p->name,p->money);
p->next;
}
system("pause");
return 0;
}