早教吧作业答案频道 -->其他-->
急求这几道c++题的答案,英文更佳1.WhatdoesinheritancemeaninC++?SupposeyouhaveclassAandclassB,underwhichofthefollowingtwoconditionsclassBshouldinheritfromclass(1)AisapartofB.(2)BisakindofA.2.Whens
题目详情
急求这几道c++题的答案,英文更佳
1.What does inheritance mean in C++?Suppose you have class A and class B,under which of the following two conditions class B should inherit from class
(1)A is a part of B.
(2)B is a kind of A.
2.When should the keyword virtual be placed before a member function of a class?Do all of the virtual member functions have to be overridden in the derived class?If not,why?
3.Does C++ support multiple inheritance?Some people think that multiple inheritance can cause a variety of ambiguity problems.Try to explain what problems will multiple inheritance cause and how to avoid them.
4.What operators cannot be overloaded in C++?What restriction applies to overloading the following operators?
=,( ),[ ],and ->.
1.What does inheritance mean in C++?Suppose you have class A and class B,under which of the following two conditions class B should inherit from class
(1)A is a part of B.
(2)B is a kind of A.
2.When should the keyword virtual be placed before a member function of a class?Do all of the virtual member functions have to be overridden in the derived class?If not,why?
3.Does C++ support multiple inheritance?Some people think that multiple inheritance can cause a variety of ambiguity problems.Try to explain what problems will multiple inheritance cause and how to avoid them.
4.What operators cannot be overloaded in C++?What restriction applies to overloading the following operators?
=,( ),[ ],and ->.
▼优质解答
答案和解析
1.Inheritance allows one data type to acquire properties of other data types.
the 2nd condition (B is a kind of A)
2.(1)When a class is having serveral base classes and the call of member function is ambigious.
(2)No,there is no need to override when it is not needed.
3.Yes.When the inherited class is using a member function or member varible which exists in more than one base classes,the computer will not know which one to use.The problem can be simply solved by using the operator '::' or define a virtual inheritance.
4.“.” “::” :” and “sizeof” can not be overloaded.
the overloading of the operator mentioned can only be defined as a member function of a class
人格保证是纯手工打造~第二题可能还要再详细些...
the 2nd condition (B is a kind of A)
2.(1)When a class is having serveral base classes and the call of member function is ambigious.
(2)No,there is no need to override when it is not needed.
3.Yes.When the inherited class is using a member function or member varible which exists in more than one base classes,the computer will not know which one to use.The problem can be simply solved by using the operator '::' or define a virtual inheritance.
4.“.” “::” :” and “sizeof” can not be overloaded.
the overloading of the operator mentioned can only be defined as a member function of a class
人格保证是纯手工打造~第二题可能还要再详细些...
看了 急求这几道c++题的答案,英...的网友还看了以下:
“三五步走遍天下,七八人百万雄兵”“咫尺地五湖四海,几更时万古千秋”,这些诗句是对戏剧艺术哪项特点 2020-05-16 …
关于拼音半夜三更、打更、几更天、五更这些“更”的读音是gēng还是jīng?有些电视剧中说是jīn 2020-05-17 …
一更是几个时辰?一夜分为几更? 2020-06-15 …
一昼夜分为几更?一更是指什么时候? 2020-06-18 …
古代一天有几更,怎么计算的? 2020-07-23 …
古代在晚上,经常有人打更,每一更有多长?有几更?每更所对应的现代的钟点有是多少? 2020-07-23 …
打更打更,几更对应着几点啊?街头篮球一区小F 2020-07-23 …
“三五步走遍天下,七八人百万雄兵”“咫尺地五湖四海,几更时万古千秋”,这些诗句是对下列中国哪种传统 2020-07-25 …
古代皇宫大院内,每晚有专门人打更,请说说“打更”是怎么回事?一夜分几更?一更多长时间? 2020-11-13 …
古人把从黄昏到第二天拂晓分为几更,其中三更大致相当于现在的几点到几点? 2020-11-24 …