Create a vector of base class objects and store derived class objects within

Firstly, if you want to use polymorphism you need to store pointers in your vector. As the vector is the sole owner of the employees something like std::vector<std::unique_ptr<Employee>> would be suitable.

Edit: I see you have updated the vector to use pointers. But you are storing a pointer to a local stack allocated object, e.g mEmp. This will not work, when the mEmp variable goes out-of-scope at the closing brace the object will be deleted and you will be left with a dangling pointer in your vector that points to a deleted object. Using this dangling pointer is undefined behaviour. You need to allocate the Manager on the heap using new. Then the object will not be deleted when the variable goes out-of-scope but you do need to remember to delete the object when you are done. Something like unique_ptr makes this easy.

Regarding your questions:

  1. Try to minimize explicit casting, especially downcasting. At the point that you store the Employee in the vector it will be implicitly upcast from the derived class to Employee but other than that there is not much need for casting.
  2. You have roughly the right idea when it comes to overriding methods, if you call the virtual printEmp method on an Employee pointer it will call the override in the derived class.

    If you are happy for the user input to be the responsibility of the Employee classes you could simply add a virtual method that initializes the employee using suitable input from the user. But I would be tempted to keep that separate from your domain objects. You need a switch statement on the user choice of employee type anyway so polymorphism doesn't gain you much there.

    If you really want to use polymorphism for the employee creation I would suggest using something like the Abstract Factory pattern.

Here is my suggestion anyway:

#include <vector>
#include <string>
#include <iostream>
#include <memory>

class Employee {
  Employee(std::string fName, std::string lName, int sal);
  virtual ~Employee();

  virtual void printEmp();

  std::string m_fName;
  std::string m_lName;
  int m_sal;

class Manager : public Employee {
  Manager(std::string fName, std::string lName, int sal, int meets, int hols);
  void printEmp() override;

  int m_meets;
  int m_hols;

Employee::Employee(std::string fName, std::string lName, int sal)
  : m_fName(fName), m_lName(lName), m_sal(sal) {

Employee::~Employee() {

void Employee::printEmp(){
  std::cout << "First Name: " << m_fName << "\n"
            << "Last Name: " << m_lName << "\n"
            << "Salary: " << m_sal << "\n";

Manager::Manager(std::string fName, std::string lName, int sal, int meets, int hols) 
  : Employee(fName, lName, sal), m_meets(meets), m_hols(hols){

void Manager::printEmp(){
  std::cout << "Meets/Week: " << m_meets << "\n"
            << "Holidays/Year: " << m_hols << "\n";

std::unique_ptr<Manager> createManager() {
  std::cout << "Enter First Name: ";
  std::string fNameInp;
  std::cin >> fNameInp;

  std::cout << "Enter Last Name: ";
  std::string lNameInp;
  std::cin >> lNameInp;

  std::cout << "Enter Salary: ";
  int salInp;
  std::cin >> salInp;

  std::cout << "Number of meetings/week: ";
  int meetsInp;
  std::cin >> meetsInp;

  std::cout << "Number of holidays/year: ";
  int holsInp;
  std::cin >> holsInp;
  std::cout << "\n";

  return std::make_unique<Manager>(fNameInp, lNameInp, salInp, meetsInp, holsInp);

std::unique_ptr<Employee> createEmployee() {
  int input;  
  std::cout << "1) Add a Manager, 2) Add an Engg, 3) Add a Researcher\n";
  std::cin >> input;    
  switch (input){
    case 1:
      return createManager();   
      return nullptr;

int main() {
  std::vector<std::unique_ptr<Employee>> dBVector; 

  std::cout << "Welcome to Employee Database, Enter an option to continue...\n";
  std::cout << "1) Add an Employee"
            << ", 2) Delete an Employee"
            << ", 3) Save Database"
            << ", 4) Exit\n";
  int input;
  std::cin >> input;

  switch (input){
    case 1:
      break; // Do nothing

Live demo

You may want to store pointers in the vector to avoid slicing, as others mentioned. Then each employee could have their own input method and ask the right questions to initialize themselves (main would not implement that but only call the respective employee's virtual input function). Input and output are conceptually sysmmetrical operations which hints at implementing them symmetrically, i.e. in this case both as member functions.