In c++ there is only virtual destructors, no constructors. Why?
Answer Posted / jos collin
The VTable is created at compile-time itself. But properly
initialized at runtime, including vptr.
Virtual Mechanism is possible only with completely
constructed objects. The constructor is called when the
object is not created completely, it is not allowed.
| Is This Answer Correct ? | 0 Yes | 6 No |
Post New Answer View All Answers
class CTest { public: void someMethod() { int nCount = 0; cout << "This is some method --> " << nCount; } }; int main() { CTest *pctest; pctest->someMethod(); return 0; } It will executes the someMethod() and displays the value too. how is it possible with our creating memory for the class . i think iam not creating object for the class. Thanks in Advance... Prakash
What is a superclass in oop?
What are the components of marker interface?
What does sksksk mean in text slang?
is there any choice in opting subjects like 4 out of 7
Can abstract class have normal methods?
What is an example of genetic polymorphism?
Can we create object of interface?
What is the difference between encapsulation and polymorphism?
How do you achieve runtime polymorphism?
when to use 'mutable' keyword and when to use 'const cast' in c++
Is react oop?
Why is static class not inherited?
What is the full form of oops?
What is multilevel inheritance?