typedef struct QNode
{
int data;
QNode* next;
}QNode,*QNodePtr;
typedef struct QueueList
{
QNodePtr front;
QNodePtr rear;
}QueueList;
void Init(QueueList* Q)
{
QNodePtr p = new QNode();
Q->rear = p;
Q->front = p;
p->next = NULL;
}
调用时:
QueueList Q;
Init(&Q);
上面调用不报错,而下面的调用报错?这是为何?
QueueList*Q = NULL;
Init(Q);