标题:谁能找到下面的程序什么地方错了!
取消只看楼主
叶赫娜拉
Rank: 1
等 级:新手上路
帖 子:11
专家分:0
注 册:2006-3-30
 问题点数:0 回复次数:1 
谁能找到下面的程序什么地方错了!

#include<stdio.h>
#include<stdlib.h>
typedef struct QNOde{
int data;
struct QNOde *next;
}QNode,*QueueList;

void EnQueue(QueueList *head,QueueList *tail,int value);
void Print(QueueList head);

int main()
{
QueueList head=NULL,tail=NULL;
int i,n,value;

printf("Please input node n: ");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
scanf("%d",&value);
EnQueue(&head,&tail,value);
}
Print(headPtr);

return 0;
}

void EnQueue(QueueList *head,QueueList *tail,int value)
{
QueueList new;

if((new=(QueueList)malloc(sizeof(QNode)))==NULL)
{
exit(1);
}
newPtr->data=value;
newPtr->next=NULL;
if(*head==NULL)
{
new->next=*head;
*head=new;
}
else
(*tail)->next=new;
*tail=new;
}

void Print(QueueList head)
{
while(head)
{
printf("%d->",head->data);
head=head->next;
}
printf("null\n\n");
}

搜索更多相关主题的帖子: return 
2006-03-30 13:09
叶赫娜拉
Rank: 1
等 级:新手上路
帖 子:11
专家分:0
注 册:2006-3-30
得分:0 
谢谢楼上两位高人帮助

千秋霸业,百战成功,边声四起唱大风 一马奔腾,射雕引弓,天地都在我心中
2006-03-30 21:23



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-53897-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.198532 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved