您的位置:首页 > 其它

编译不过,怎么会回事?

2015-10-24 17:34 399 查看
#include <stdio.h>

typedef struct node
{
char info;
struct node *next;
}headlink;

void main()
{
headlink *head;
head=creat();
print(head);
getch();
}

headlink *creat()
{
headlink *head, *p;
char c;
head=NULL;
while((c=getchar())!='\n')
{
p=(headlink *)malloc(sizeof(headlink));
p->info=c;
p->next=head;
head=p;
}
return (head);
}

void print(headlink *head)
{
headlink *p;
p=head;
while(p)
{
putchar(p->info);
p=p->next;
}
}
编译不过,怎么会回事?看不出那里错了,帮忙看看!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: