好了,所以这是我迄今为止解决分配不兼容的类型......如何使用节点指针以建立一个链表
typedef struct node{
int *next;
int val;
}node;
void pqPrint(){
node *current=front;
printf("Queue Contains:");
while(current->next!=NULL){
printf(" %d ", current->val);
node temp;
temp.next=current->next;
current->next=temp;
}
printf("\n");
}
我不断收到上述错误与current->next=temp;
'temp'不是指针。 – BLUEPIXY 2014-10-11 22:02:28
,因为“temp”不是指针。为什么你甚至需要它?这看起来真的很糟糕。为什么你的下一个指针是“int *”而不是“node *”? – OldProgrammer 2014-10-11 22:03:44