Answer Posted / achal
the concept of vitual function comes when inheritance is at
work. If the overriden function is not made virtual in base
class , then pointer of derived class will call the funtion
in base class(instead it should have called the one from
derived class.)
this is why we make the function in base as virtual.
| Is This Answer Correct ? | 37 Yes | 6 No |
Post New Answer View All Answers
c++ program to swap the objects of two different classes
What do you mean by variable?
Why is it so that we can have virtual constructors but we cannot have virtual destructors?
What is byval and byref? What are differences between them?
How to call a non virtual function in the derived class by using base class pointer
what type of questions
This program numbers the lines found in a text file. Write a program that reads text from a file and outputs each line preceded by a line number. Print the line number right-adjusted in a field of 3 spaces. Follow the line number with a colon, then one space, then the text of the line. You should get a character at a time and write code to ignore leading blanks on each line. You may assume that the lines are short enough to fit within a line on the screen. Otherwise, allow default printer or screen output behavior if the line is too long (i.e., wrap or truncate). A somewhat harder version determines the number of spaces needed in the field for the line numbers by counting lines before processing the lines of the file. This version of the program should insert a new line after the last complete word that will fit within a 72-character line.
Where is pseudocode used?
Is abstract thinking intelligence?
Which type does string inherit from?
i=20;k=0;
for(j=1;k-i;k+=j<10?4:3)
{
cout< Can main method override? Can we override main method? What are objects in oop? What is destructor in oop?