Home > Back-end >  C polymorphism of a small problem
C polymorphism of a small problem

Time:09-25

1, pure virtual function in the base class does not provide its specific implementation? I have a program is if you don't provide will not be able to continue to the back of the operation, but I provides its concrete implementation is not wrong, but running right, strives for the bosses to give directions,
2, using virtual declare a virtual function in a base class, but behind all of the derived class if useful to this function in the base class, if we can no longer write virtual. Can also write? Write a function in the interface function with virtual, in its concrete realization function is not can write virtual this keyword (I try to write there will be wrong)
Your bosses to give directions, thank you!

CodePudding user response:

Yourself to try to know

CodePudding user response:

reference 1/f, the truth is right or wrong response:
myself to try to know

Tried, but I want to listen to the original message,

CodePudding user response:


CodePudding user response:

reference MianHou reply: 3/f


That is in the process of pure virtual functions only as the back of the base class inheritance, inheritance rewritten again?

CodePudding user response:

https://zh.cppreference.com/w/cpp/language/member_functions

CodePudding user response:

LINUX/reference 4 floor response:
Quote: refer to the third floor MianHou response:


That is in the process of pure virtual functions only as the back of the base class inheritance, inheritance rewritten again?

For the

CodePudding user response:

refer to 6th floor MianHou response:
Quote: LINUX/reference 4 floor response:

Quote: refer to the third floor MianHou response:


That is in the process of pure virtual functions only as the back of the base class inheritance, inheritance rewritten again?

The

Well, ok, thank you.

CodePudding user response:

refer to fifth floor truth is right or wrong response:
https://zh.cppreference.com/w/cpp/language/member_functions

Thank you bosses ha,
  • Related