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!
Virtual Functions
The keyword virtual was previously used to resolve ambiguity for a class derived from two classes, both having a common ancestor. These classes are known as virtual base classes. This time it helps in implementing the idea of polymorphism with class inheritance. The function of the base class can be declared with the keyword virtual. The program with this change and its output is given below.
class Shape
{
public :
virtual void print()
cout << " I am a Shape " << endl;
}
};
class Triangle : public Shape
void print()
cout << " I am a Triangle " << endl;
class Circle : public Shape
cout << " I am a Circle " << endl;
void main()
Shape S;
Triangle T;
Circle C;
S.print();
T.print();
C.print();
Shape *ptr;
ptr = &S;
ptr -> print();
ptr = &T;
ptr = &C;
Project Description: Project Description: I am seeking a programmer who will be able to design some software that will allow the user to: 1) Repeatedly monitor Nike twitter a
Many modern cryptography algorithms require two numbers that are coprime, or sometimes referred to as relatively prime. Two numbers are coprime if their greatest common divisor is
What is the real function of class - to export data? No, Real purpose of a class isn't to export data. Instead, it's to provide services. Class provides a way to abstract behav
example of padovan string program
Normal 0 false false false EN-US X-NONE X-NONE
A: Use references when you can use, and use pointers when you have to. References are generally preferred over pointers whenever you don't require "reseating". Usually this mean
Write a ''C'' program to accept any 3 digit integer number from the keyboard and display the word equivalent representation of the given number
I would like to get you to collaborate in my project. We want a C programmer to Develop applications for Windows, the first application may be an Instant messenger encrypted in a w
Write a function that calculates the number of elapsed days between two dates. For example the days between Feb 3, 1970 and June 21, 1980? Becareful for the Leap year
You are required to give C++ implementation of following classes: 1. PropertyCategories 2. Plot 3. Flat 4. House Following is the description of all data member and member funct
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