早教吧作业答案频道 -->其他-->
急求这几道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++题的答案,英...的网友还看了以下:
英语急!翻译(请不要用翻译机翻译)我想成为一位导游,我学英语已经有5年了.因为学英语可以丰富我的课外 2020-03-29 …
急需翻译把下列短语译成英文:1.亲自2.愿意.便宜3.到达4.不只这些急! 2020-04-11 …
请英语高手帮忙翻译一下这篇短文,中翻英,急需,谢谢中国自古是一个礼仪之邦,有着五千年的优良传统!然 2020-04-11 …
九年级英语汉翻英急死了!1.这本英汉字典肯定是他的,这上面有他的名字.2.两头狮子从当地动物园逃走 2020-05-13 …
英语翻译就是机械方面的就行了...要英语翻译成汉语 或汉语翻译成英语的~都可以 但是 必须是一篇文 2020-05-17 …
这是急.急爸爸让我今天写完英语作业你第一次过来英国是什么时候?用英语回答 2020-05-22 …
谁能帮我找一篇关于政府雇员的英文原文?大概3000个词这样.急很着急先给一百分,好的话再加两百.T 2020-06-15 …
中翻英,急,高手帮忙这一程深情缘浅,走到今天,已经不容易,轻轻地抽出手,说声再见,真的很感谢,这一 2020-06-17 …
英语翻译。我刚才没有注意到他他独自一人来的。一周很快就过去了。没必要这样急急忙忙。他向我英语翻译。我 2020-11-27 …
中译英急!1.你认为我该接受她的劝告吗?2.晚饭后出去散步是个好主意吗?3.你最好别把这个坏消息告诉 2020-12-19 …