Can we call a virtual function from a constructor?
You can call a virtual function in a constructor, but be careful. ... In a constructor, the virtual call mechanism is disabled because overriding from derived classes hasn't yet happened. Objects are constructed from the base up, “base before derived”.
Is This Answer Correct ? | 0 Yes | 0 No |
What is an abstract class?
How to run C++ program in cmd
Explain the operator overloading feature in C++ ?
What are issues if we mix new and free in C++?
Declare a pointer to a function that takes a char pointer as argument and returns a void pointer.
How to convert integer to string in C++
How many times will this loop execute? Explain your answer.
What does it mean to declare a member function as virtual in C++?
Can we call a virtual function from a constructor?
What are pass by value and pass by reference?what is the disadvantage of pass by value?
Difference between function overloading and function overriding.
What is the difference between virtual functions and pure virtual functions?