new and delete operator

new operator is used to allocate memory in runtime. This memory is allocated from heap segment of a process. To understand how new operator works, let us see with the help of an example. #include <iostream>using namespace std;class employee {    unsigned short m_age;    unsigned int m_salary;public:    employee() {}    employee(unsigned short age, unsigned int salary) {        m_age = age;        m_salary = salary;    }};int main() {    employee* emp = new employee(30, 40,000);    delete emp;    return 0;} Here new is called for the employee object by passing the value as per the constructor…