请问这个错是什么原因呢?

happy_swallow 2004-03-14 03:43:13
two or more data types in declaration of 'test'
函数是这样的:
test(int sock,struct connection *c,long policy,unsigned long try),请大家帮忙看看?
...全文
32 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
happy_swallow 2004-03-14
  • 打赏
  • 举报
回复
谢谢你,hpho(),解决了!
hpho 2004-03-14
  • 打赏
  • 举报
回复
typedef unsigned long lest;
struct connection{
char *name;
lest policy;
struct connection *next;
}; // <-- ';'

void test(int sock,struct connection *c,long policy,lest try)
{
}
happy_swallow 2004-03-14
  • 打赏
  • 举报
回复
a.h中写了这样一些:
typedef unsigned long lest;
struct connection{
char *name;
lest policy;
struct connection *next;}
test(int sock,struct connection *c,long policy,lest try)
把这个.h包含在.c中编译就报错,请问为什么,很急.
happy_swallow 2004-03-14
  • 打赏
  • 举报
回复
请问这样的定义不可以吗?
DarkSideOfHeart 2004-03-14
  • 打赏
  • 举报
回复
可能是你定义了其它的变量名也叫test吧,最好把代码都帖出来,这样谁也看不出那有问题。
byyyyy 2004-03-14
  • 打赏
  • 举报
回复
struct connection *c

70,037

社区成员

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

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