错误:expected ‘)’ before ‘Book’

Echo_Anna 2016-10-22 11:10:34
struct contact
{
char name[5]; //联系人姓名
int ph[11]; //联系人手机号码
char add[50]; //联系人地址
};
typedef struct contact Contact;

struct book
{
int size; //通讯录的容量
int num; //当前通讯录里的人数
Contact *con; //嵌套结构,联系人信息
};
typedef struct book *BOOK;


子函数是add(BOOK Book),我用makefile调试,调试,调试错误 “错误:expected ‘)’ before ‘Book’“”
...全文
319 7 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
Echo_Anna 2016-10-24
  • 打赏
  • 举报
回复
是自己理解错了,以为makefile的子函数不需要添加头文件,在每个子函数的开头添加头文件就好了
赵4老师 2016-10-23
  • 打赏
  • 举报
回复
偶遇到类似问题都是用 “每次用/*...*/注释掉不同部分再重新编译,直到定位到具体语法出错的位置。” 的方法解决的。
Echo_Anna 2016-10-23
  • 打赏
  • 举报
回复
就是在第一行就报错了 void add(BOOK Book),这是第一行的代码
Echo_Anna 2016-10-23
  • 打赏
  • 举报
回复
我用的makefile管理的代码,功能子目录里的函数开头不需要include包含头文件的
fefe82 2016-10-23
  • 打赏
  • 举报
回复
引用 2 楼 Echo_Ana 的回复:
就是在第一行就报错了 void add(BOOK Book),这是第一行的代码
第一行?前面没个 #include ?
eastfriendwu 2016-10-23
  • 打赏
  • 举报
回复
没有代码帮不了你。
首先你要include上面定义的结构体吧?
eastfriendwu 2016-10-22
  • 打赏
  • 举报
回复
看看编译器报错的行号,是不是周围代码缺少了一些字符? 上面的结构体定义没有问题。
This book, like so many, has grown from an undergraduate Networking course. Its current content is rather more than a single course could comfortably cover, though it is all relevant for an adventurer into the jungle of networks. It is somewhat biased towards the Internet and the protocols the Internet uses, namely TCP/IP. Other network technologies are touched on more to give a flavour of alternatives and contrasts of approaches than to give a deep insight. In fact, to give a deep insight into any single aspect of networking is worth a book in its own right, so I have had to be somewhat selective in the topics covered. Though, in the end, the criterion of choice for inclusion is simple: this book contains the stuff I find interesting about networking. The intent is to provide a taster for many concepts, but with enough information for the reader to follow up and deepen their understanding. For the details, please refer to the various RFCs and standards documents that are listed in the margins. RFC 2555 As is traditional, each chapter ends with some exercises. What is less traditional is their form: they are less of the ‘write down everything you know’, but more ‘go and try this’. You are expected to find out things for yourself and experiment! You may need to read up and learn other things before you can tackle the problems directly: this is all part of the exercise. The best way of learning this kind of material is by direct experience. And quite often there might not be a single answer, or even a ‘right’ answer.

70,023

社区成员

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

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