C with classes
This commit is contained in:
19
ObjectOrientedProgramming/virtualclasstest/b.h
Normal file
19
ObjectOrientedProgramming/virtualclasstest/b.h
Normal file
@@ -0,0 +1,19 @@
|
||||
#ifndef B_H
|
||||
#define B_H
|
||||
|
||||
#include <iostream>
|
||||
#include "a.h"
|
||||
class B : virtual public A{
|
||||
private:
|
||||
A* base;
|
||||
int js;
|
||||
public:
|
||||
B() = delete;
|
||||
B(int n = 1) : A(12,6), base(this), js(n){}
|
||||
void p() override ;
|
||||
friend std::ostream& operator<<(std::ostream& os , B& x);
|
||||
~B(){}
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user