- 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语言转向c(TurnfromCtoc)
从c语言转向c++(Turn from C to c++)
Chapter 1 turns from C to C++
For everyone, it takes some time to get used to C++, and this process is especially distressing for programmers who are already familiar with C. Since C is a subset of C++, all C technologies can continue to be used, but many are not very useful. For example, C++ programmers think that pointer pointers look strange, and they ask, why dont you use pointers instead?
C is a simple language. It provides only macros, pointers, structures, arrays, and functions. No matter what the problem is, C is solved by macros, pointers, structures, arrays, and functions. And C++ isnt like that. Acer, pointers, structures, arrays and functions and there are of course, in addition to private and protected members, function overloading and default parameters, constructor and destructor, custom operators, inline functions, references, friends, templates, exceptions, name space, etc.. Using C++ has wider space than using C because there are more options to consider when designing.
In the face of so many choices, many C programmers stick to their old habits. Generally speaking, this is not a big sin. But certain C habits are contrary to the spiritual nature of C++, and they are described in the following terms.
--------------------------------------------------------------------------------
Clause 1: try to use const and inline instead of #define
This clause is best referred to as try to use the compiler without preprocessing because #define is often thought to be not part of the language itself. Thats one of the problems. Look at the following statement:
#define ASPECT_RATIO 1.653
The compiler will never see the name of the ASPECT_RATIO because it will be removed by the handler before the source gets into the compiler, so ASPECT_RATIO will not be added to the list of symbols. If the code involved in this constant is wrong at compile time, it will be very confusing because the error message refers to 1.653 instead of ASPECT_RATIO.
您可能关注的文档
- 北京弘扬万家(Beijing to promote 10000).doc
- 北京所有综合市场大全(All comprehensive markets in Beijing).doc
- 北京旅游攻略2010(Beijing Travel Guide 2010).doc
- 北京翱翔少年680分飞进清华(Beijing soaring juvenile 680 points flying into Tsinghua).doc
- 北京郊区好玩地方推荐(作者自己整理)(Beijing suburb fun places recommended (the author himself finishing)).doc
- 北京部分消防应急系统灯厂家(Beijing some fire emergency system lamp manufacturers).doc
- 北大二十道国际金融题目(Beijing twenty international financial issues).doc
- 北仑大润发时刻表(Beilun RT Mart schedule).doc
- 北大天文学就业_2010年物理学院双学位简章(Double degree. Peking University School of Physics Astronomy employment _2010).doc
- 北师大版三年级数学第三单元《乘法》10814(Beijing Normal University edition three grade third math unit multiplication 10814).doc
- 从亿万富翁到一贫如洗 首家民营环保企业的历程(From billionaires to impoverished private environmental enterprises).doc
- 从亿万富豪到一美元市长(From billionaires to one dollar mayor).doc
- 从个人魅力型向制度约束型企业转变(From personal charisma to institutional change).doc
- 从化街道、地名(Streets and places of Conghua).doc
- 从宽带开始 田溯宁、李泽楷第二次亲密接触(From broadband start, Richard Lee, second close contact).doc
- 从卖产品转向卖体验老品牌也能风光再现(From selling products to selling experience, the old brands can also reappear).doc
- 从地毯式轰炸到精确制导谈市场营销(Talking about marketing from carpet bombing to precision guidance).doc
- 从未败北的人(A man who never fails).doc
- 从猴子够香蕉看新员工培训(From monkey to banana, see new employee training).doc
- 从百强县分析广东县域发展的存在问题(Analysis of the existing problems of county development in Guangdong from the top 100 counties).doc
最近下载
- 中学食堂建设项目社会稳定风险评估报告(模板范文).docx
- 第9课 互传密信有诀窍 教案 义务教育人教版信息科技五年级全一册.docx VIP
- 根本原因分析精神病人自杀RCA.pptx VIP
- SL523-2024 水土保持监理规范.docx VIP
- 路面结构层厚度评定表(代表值自动计算).xls VIP
- 雨虹防水质保合同范本Word模板.docx VIP
- 旅游产品策划与设计422全书教学课件电子教案.ppt
- Toll样受体信号通路中MyD88的研究进展_吴燕燕.pdf VIP
- 2024水土保持工程施工监理规范.docx VIP
- 义务教育版(2024)五年级全一册 第1课 生活处处有算法 教案.docx VIP
文档评论(0)