| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 680 人关注过本帖
标题:谁能找到下面的程序什么地方错了!
取消只看楼主 加入收藏
叶赫娜拉
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
快速回复:谁能找到下面的程序什么地方错了!
数据加载中...
 
   



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

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