请教高手,哪里错了?
#include <iostream>
using namespace std;
struct Book
{
int num;
float price;
struct Book*next;
};
void main()
{
Book x,y,z,*head,*p;
x.num=10000;
x.price=15.6f;
y.num=20000;
y.price=16.8f;
z.num=30000;
z.price=18.6f;
head=&x;
x.next=&y;
y.next=&z;
z.next=NULL;
while (p!=NULL)
{
cout<<p->num<<endl<<p->price<<endl;
p=p->next;
}
}