CPP
cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*
https://www.sololearn.com/Discuss/3240298/?ref=app
*/
#include <iostream>
using namespace std;
#include <memory>
class IEmployee
{
public:
virtual void getInfo() = 0;
IEmployee(string name,int id) : m_strName(name), m_intId(id) {}
protected:
string m_strName;
int m_intId;
};
class Developer : public IEmployee
{
public:
Developer(string name, int id) : IEmployee(name,id) {}
void getInfo() { cout << "A developer here.! Name : " << m_strName << " ID : " << m_intId << endl; }
};
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run