From e61ccb8ae88d2f52504cfd388973327965ed3c62 Mon Sep 17 00:00:00 2001
From: Technical Vandar
 <73782935+Technical-Vandar-885@users.noreply.github.com>
Date: Fri, 1 Oct 2021 20:07:51 +0545
Subject: [PATCH] Create Pure_Virtual_Function.cpp

---
 algorithms/Pure_Virtual_Function.cpp | 39 ++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)
 create mode 100644 algorithms/Pure_Virtual_Function.cpp

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<iostream>
+using namespace std;
+class B
+{
+    public:
+        virtual void show()
+        {
+            cout<<"This Is class B"<<endl;
+        }
+};
+class D1:public B
+{
+    public:
+        void show()
+        {
+            cout<<"This Class D1"<<endl;
+        }
+};
+class D2:public B
+{
+    public:
+        void show()
+        {
+            cout<<"This Is Class D2";
+        }
+};
+
+int main()
+{
+    B *p;
+    D1 obj1;
+    D2 obj2;
+    B objbase;
+    p=&objbase;
+    p->show();
+    p=&obj2;
+    p->show();    
+    return 0;
+}