错误: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’“”
...全文
298 7 打赏 收藏 转发到动态 举报
写回复
用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
  • 打赏
  • 举报
回复
看看编译器报错的行号,是不是周围代码缺少了一些字符? 上面的结构体定义没有问题。
Title: CentOS High Availability Author: Mitja Resman Length: 156 pages Edition: 1 Language: English Publisher: Packt Publishing Publication Date: 2015-04-30 ISBN-10: 1785282484 ISBN-13: 9781785282485 Leverage the power of high availability clusters on CentOS Linux, the enterprise-class, open source operating system About This Book Install, configure, and manage a multi-node cluster running on CentOS Linux Manage your cluster resources and learn how to start, stop, and migrate resources from one host to another Designed as a step-by-step guide, this book will help you become a master of cluster nodes, cluster resources, and cluster services on CentOS 6 and CentOS 7 Who This Book Is For This book is targeted at system engineers and system administrators who want to upgrade their knowledge and skills in high availability and want to learn practically how to achieve high availability with CentOS Linux. You are expected to have good CentOS Linux knowledge and basic networking experience. In Detail The high performance and stability of CentOS Linux are the key factors that make CentOS Linux the right Linux distribution to build high availability solutions on. This book introduces you to high availability before briefly walking you through the cluster stack and its layers. The book is then divided into two parts, part A and part B, based on CentOS versions 6 and 7 respectively. Each part begins with the installation and configuration of the Corosync cluster messaging software with CMAN or with the Pacemaker cluster resource management software. You will also be introduced to cluster service configuration and cluster service management before you configure fencing or STONITH on CentOS 6 and CentOS 7. By the end of this book, you will have the skills required to independently design, implement, and maintain a CentOS high availability multinode cluster environment. Table of Contents Chapter 1: Getting Started with High Availability Chapter 2: Meet the Cluster Stack on CentOS Chapter 3: Cluster Stack Software on CentOS 6 Chapter 4: Resource Manager on CentOS 6 Chapter 5: Playing with Cluster Nodes on CentOS 6 Chapter 6: Fencing on CentOS 6 Chapter 7: Testing Failover on CentOS 6 Chapter 8: Two-node Cluster Considerations in CentOS 6 Chapter 9: Cluster Stack Software on CentOS 7 Chapter 10: Resource Manager on CentOS 7 Chapter 11: Playing with Cluster Nodes on CentOS 7 Chapter 12: STONITH on CentOS 7 Chapter 13: Testing Failover on CentOS 7 Chapter 14: Two-node Cluster Considerations on CentOS 7
book is for you All you really need before starting the book is a decent knowledge of HTML 4 0 The better you know HTML of course the better prepared you"ll be You will need to know very little else in order to follow this book This second edition of the book covers CSS2 and CSS2 1 the latter of which is in many ways a clarification of the first While some CSS3 modules have reached Candidate Recommendation status as of this writing I have chosen not to cover them in this edition This was done in part because the book seemed long enough without them but also because implementation of these modules is still incomplete I feel it"s important to keep the book focused on currently supported and well understood levels of CSS and leave any future capabilities for future editions Remember one thing about web standards and books: the former are continually evolving while the latter are frozen in time until the next edition comes out anyway In the case of X HTML and CSS many changes are afoot even as these words are being written Despite this it is my hope that this second edition will stay relevant over a period of several years as did the first edition In order to keep the text relevant as well as to save space I cut CSS support information from this edition Such information is much better published online where it can be corrected and updated whenever there are changes in browser CSS support Committing such information to paper while useful in the first edition no longer makes a great deal of sense This is doubly true because CSS support has advanced so far in the last few years that whatever bugs remain are difficult to express in a simple chart For example as of this writing there is a bug in Safari in which applying text transform through a :first letter rule triggers some very strange behavior There is practically speaking no good way to represent this in a chart even a three dimensional array Furthermore the bug is expected to be fixed in the very near future and in fact may already have been fixed by the time this book is on shelves Therefore rather than doom large portions of the book to obsolescence the moment they are published I instead dropped the information Doing so actually enabled me to keep the book from growing too much while adding a great deal more information The support information I did preserve was that relating to bugs and limitations in the Internet Explorer line which has ceased development">book is for you All you really need before starting the book is a decent knowledge of HTML 4 0 The better you know HTML of course the better prepared you"ll be You will need to know very little else in order to follow this book This second edition of the book covers CSS2 and CSS2 1 the l [更多]

69,364

社区成员

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

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