Home > Back-end >  About abstract class instantiation
About abstract class instantiation

Time:10-07

I have a job, ListInterface. All private functions in h, then in BrowserHistoryInterface. H contained in the header file, one of the functions of virtual void copyCurrentHisotory (ListInterface& Destination)=0;

Really confused how to use this function,
Ask the man answer, thank you!

CodePudding user response:

Pure virtual function, need to inherit class writing implement,
Class a
{
Public:
Virtual void fun (void)=0;
};
The class aa: public a
{
Public:
Virtual void fun (void) {cout<" Aa "& lt; };

CodePudding user response:

reference 1st floor lirg8405 response:
pure virtual function, need to inherit class writing implement,
Class a
{
Public:
Virtual void fun (void)=0;
};
The class aa: public a
{
Public:
Virtual void fun (void) {cout<" Aa "& lt; };

If it's private,
Virtual void copyCurrentHistory (ListImterface& Parameters should be in the destination) cannot be accessed, how let him realize the function,

CodePudding user response:

refer to the second floor ChangeFm response:
Quote: refer to 1st floor lirg8405 response:
pure virtual function, need to inherit class writing implement,
Class a
{
Public:
Virtual void fun (void)=0;
};
The class aa: public a
{
Public:
Virtual void fun (void) {cout<" Aa "& lt; };

If it's private,
Virtual void copyCurrentHistory (ListImterface& Parameters should be in the destination) cannot be accessed, how let him realize the function,

Same, private just outside can't call, can call the class's interior,
  • Related