diff --git a/algorithms/Pure_Virtual_Function.cpp b/algorithms/Pure_Virtual_Function.cpp new file mode 100644 index 00000000..d0023253 --- /dev/null +++ b/algorithms/Pure_Virtual_Function.cpp @@ -0,0 +1,39 @@ +#include +using namespace std; +class B +{ + public: + virtual void show() + { + cout<<"This Is class B"<show(); + p=&obj2; + p->show(); + return 0; +}