Question: #define _CRT_SECURE_NO_WARNINGS #include using namespace std; class MyInt { int *m_data; public: MyInt(int val){ m_data = new int(val); } ~MyInt() { cout < < deleting:

#define _CRT_SECURE_NO_WARNINGS #include using namespace std;

class MyInt { int *m_data; public: MyInt(int val){ m_data = new int(val); } ~MyInt() { cout << "deleting: " << *m_data << endl; delete m_data; } // Create an assignment operator to set one MyInt to another // and return a reference of the current object

MyInt& operator = ( const MyInt &myint) {

m_data = myint.m_data; if (&myint !=this) { this.m_data = myint.m_data } return *this;

}

// Create an assignment operator to set one MyInt to another // and return a reference of the current object

how do i do this part? i attempted it below..

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!