Too many types in declaration!

fgcp230 2004-09-03 08:54:25
程序代码如下:
#include <stdio.h>
#include <string.h>

struct node
{
struct node * prev;
char * name;
char * qq;
char * mobilephone;
char * email;
struct node* next;
}
struct node * newnode()//tc在此行提示“Too many types in declaration!”,什么原因啊?急!
{
struct node * p;
printf("\nenter your name:");
gets(p->name);
printf("\nenter your qq:");
gets(p->qq);
printf("\nenter your mobilephone:");
gets(p->mobilephone);
printf("\nenter your email:");
gets(p->email);

return (p);
}
void printnode(struct node * p)
{
printf("\nthe name you entered is:%s",p->name);
printf("\nthe qq you entered is:%s",p->qq);
printf("\nthe mobilephone you entered is:%s",p->mobilephone);
printf("\nthe email you entered is:%s",p->email);
return;
}
main()
{
struct node * n1;
clrscr();
n1=newnode();
printnode(n1);
exit(1);

}
...全文
168 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
fgcp230 2004-09-03
  • 打赏
  • 举报
回复
确实是掉了分号的问题,感谢sekelon(罗伦罗亚索龙)!!!
Lonelywolf1899 2004-09-03
  • 打赏
  • 举报
回复
sekelon(罗伦罗亚索龙)
---------------------
说得对
  • 打赏
  • 举报
回复
sekelon(罗伦罗亚索龙) 正解
banjo 2004-09-03
  • 打赏
  • 举报
回复
没有预先声明吧

#include <stdio.h>
#include <string.h>

strcut node;//这一句
sekelon 2004-09-03
  • 打赏
  • 举报
回复
struct node
{
struct node * prev;
char * name;
char * qq;
char * mobilephone;
char * email;
struct node* next;
};//<----这个地方少个分号

70,037

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧