Already have an account? Get multiple benefits of using own account!
Login in your account..!
Remember me
Don't have an account? Create your account in less than a minutes,
Forgot password? how can I recover my password now!
Enter right registered email to receive password!
Problems With Multiple Inheritance
The following example presents a problem with multiple inheritance.
class Aclass
{
public :
void put()
:
}
};
class Bclass
class Cclass : public Aclass , public Bclass
void main()
A objA;
B objB;
C objC;
objA.put(); // From Class A
objB.put(); // From class B
objC.put(); // AMBIGUOUS -RESULTS IN ERROR
The above example has a class C derived from two classes A and B. Both these classes have a function with the similar name - put(), which suppose, the derived class does not have. The class C inherits the put() function from both the classes. When a call to this function is made using the object of the derived class , the compiler does not know which class it is referring to. In this case, the scope resolution operator has to be used to state the correct object . Its usage is very simple. The statement giving an error from the above instance has to be replaced with the following :
objC.A::put(); // for class A
objC.B::put(); // for class B
C Program for EVEN & ODD NO IN ANY MATRICES #include stdio.h> #include conio.h> void main() { int a[100][100]; int i=0,j=0,r,c,even=0,odd=0;
Overloading a method (or function) in C++ is the ability for functions of the similar name to be defined as long as these methods have dissimilar signatures (different set of param
Question : (a) Define a Pointer. Provide an example of an integer pointer variable. (b) Give advantages of using pointers over arrays. (c) Declare an integer pointer
write a simple c++ program to implement a stack: 1. push 2. pop
A string S is said to be "Super ASCII", if it contains the character frequency equal to their ascii values. String will contain only lower case alphabets (''a''-''z'') and the asci
Explain the class invariant. - It's a condition that ensures correct working of a class and defines all the valid states for an object. - When an object is created class inv
C Program for ADD,SUB,MUL,DIV,REM void main() { int a,b,c,ch=0; clrscr(); while(ch { printf(" \n\n 1:- For To Add\n 2:- For
A: It let you to provide an intuitive interface to users of your class, as well as makes it possible for templates to equally work well with classes and built-in/intrinsic types.
Primarily the term alignment refers the tendency of an address pointer value to be a multiple of some power of two. Thus a pointer with two byte alignment contains a zero in the le
Q: When should you employ multiple inheritance? A:There are three acceptable answers:- "Rarely," "Never," and "while the problem domain cannot be modeled accurately any
Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!
whatsapp: +91-977-207-8620
Phone: +91-977-207-8620
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd