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;
To write a program to use different levels of array of pointer to pointer & display the output as 1 1 1 2 2 2 3 3 3
A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome
Abstract array - c program: AbstractArray::AbstractArray( int anUpper, int aLower, sizeType aDelta ) { PRECONDITION( anUpper >= aLower ); lastElementIndex = a
Define global variable in c++ program: How to define a global variable and need of global variable in c++ program. int main() { int m=20; clrscr(); for
Project Description: We are seeking online invoice OCR solution. That will help us to automate accounts payable function. User should be able to use the offered pdf file or s
Define How Passing Arrays to a Function? A complete array can be passed to a function as an argument. The manner in which the array is passed be different from that of an ordin
derivations 1. Regardless of the type of derivation, private members are inherited by the derived class, but cannot be accessed by the new member function of the derived class,
Write C code for a program that implements a digital clock (HH:MM:SS). The clock includes a two-digit hour indicator HH (00-23), a two-digit minute indicator MM (00-59), and a t
push and pop operation using array draw flowcharts
C Program to FIND VOWELS void main() { char str[50]; int ac=0, ec=0, ic=0, oc=0, uc=0; int i,stln,vc,word=1; clrscr
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