网站大量收购闲置独家精品文档,联系QQ:2885784924

C 08《多态性》(国外英文资料).doc

  1. 1、本文档共20页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
C 08《多态性》(国外英文资料)

C 08《多态性》(国外英文资料) C++08 polymorphism,.Txt VC++ eighth class 2004.3.31 polymorphism I. overview of polymorphism Polymorphism: a name, multiple functions. Polymorphic types: compile time polymorphism and runtime polymorphism. Static binding: depending on the arguments used, the compiler can determine which function to call. Mainly refers to the realization of overloading function linkage, can also include class templates, implicit type conversion implementation of the couplet. Dynamic linking: when a program runs, it calls the member function of the object according to the actual object it refers to. Chrysene - - grosseserrata chrysene grosseserrata Of static binding and dynamic binding,,, -- -- Scott Produced, respectively. Here Chrysene ---- grosseserrata chrysene ---- grosseserrata Polymorphism, polymorphism, and, when run, compile ---- ---- Advantages: speed, advantages: flexibility Disadvantages: lack of flexibility: bad execution Implementation: implemented with overloaded functions: through inheritance and virtual functions Two, the basic properties of virtual functions General virtual function members writing: add the virtual before the function prototype of the base class, and do not add it when implemented Such as: Class A { Public: Virtual void (f); / / virtual function }; Must be public derived; The virtual property can be passed along a derived relationship and cannot be uploaded; the base classs function is virtual, and the same name function (and the same parameter, the same return type) of the subclass is also virtual. Access authority: (1) dynamic calling is invoked when a virtual function is called through a pointer of a base class type (2) dynamic invocation is also called when a virtual function is called through a reference to a base class type (3) call a virtual function through an object, then use a static join (4) ---------------------------------------------------------------------------------- Legend 1: a class of directed acyclic graphs (DA

文档评论(0)

f8r9t5c + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

版权声明书
用户编号:8000054077000003

1亿VIP精品文档

相关文档