- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
c头文件作用(Cheaderfileaction)
c++头文件作用(C++ header file action)
header file
Each C++/C program is usually divided into two files. A file used to hold program declarations (Declaration), called header files. Another file is used to save the programs implementation (Implementation), called the definition file.
C++/C program header file to .H as a suffix, C program definition file with the .C suffix, C++ program definition file suffix usually with .Cpp (there are some systems with .Cc or .Cxx suffix).
1.1 copyright and version statements
The copyright and version declarations are at the beginning of the header file and the definition file (see example 1-1):
(1) copyright information.
(2) file name, identifier, abstract.
(3) current version number, author / modifier, date of completion.
(4) version history information.
Example 1-1 copyright and version declarations
1.2 header file structure
The header file consists of three parts:
(1) copyright and version declarations at the beginning of the header file (see example 1-1).
(2) pretreatment block.
(3) functions and classes, structure declarations, etc..
Suppose the header file name is graphics.h, and the structure of the header file is shown in example 1-2.
[rule 1-2-1) to prevent header files from being repeatedly referenced, a preprocessing block should be generated with the ifndef/define/endif structure.
[rule 1-2-2] refer to the header file of the standard library in #include filename.h format (the compiler will start searching from the standard library directory).
[rule 1-2-3] use the #include filename.h format to refer to the header file of the nonstandard Library (the compiler will search from the users working directory).
[recommendation 1-2-1] only the declaration is stored in the header file, not the definition
In C++ syntax, the member functions of a class can be defined at the same time as they are declared, and automatically become inline functions. Although this will bring about the convenience of writing, but it has resulted in inconsis
您可能关注的文档
- 2010年大学生村官备考面试行为礼仪指导(三)-村官面试_村官面试题_大学生村官面试_大学生村官面试考试网(In 2010 college-graduate village official remarks a behavioral interview etiquette guide (three) - interview interview questions _ village village _ col.doc
- 2010年广西师范大学大学生寒假社会实践活动(In 2010, Guangxi Normal University students winter vacation social practice).doc
- 2010年度福建企业100强排行榜(Fujian top 100 list of enterprises in 2010).doc
- 2010年新课标省市高三语文模拟试卷分类汇编(Compilation and classification of Chinese language simulation papers for senior high school in 2010).doc
- 2010年河北省选调生邢台面试真题(6分2道)(Hebei Province in 2010 selected graduates Xingtai interview (6 2)).doc
- 2010年自考文学类美学冲刺复习资料详解汇总(In 2010, I reviewed the literature aesthetics and reviewed the data in detail).doc
- 2010年度最受赞赏的知识型公司排行榜(List of the Most Admired Knowledge Companies in 2010).doc
- 2010我们拿什么赚钱(2010 what do we make money).doc
- 2010教师招聘(2010 teacher recruitment).doc
- 2010最新网域高科学校使用修改问答(2010, the latest domain tech schools use modified questions and answers).doc
- cass运用技巧(Cass application skills).doc
- caoan(曹).doc
- ceo业绩评估与激励(CEO performance evaluation and motivation).doc
- cet4新题型预热(CET4 new questions preheat).doc
- cet-4改革(CET-4改革).doc
- cfg地基处理(CFG foundation treatment).doc
- ceo突意外 谁来撑起企业的天(CEO sudden accident, who will prop up the enterprise days).doc
- cio如何化解项目管理中的角色冲突(How does CIO resolve role conflicts in project management).doc
- ckeditor的详细配置(Detailed configuration of ckeditor).doc
- code of carrier(代码载体).doc
文档评论(0)