Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

#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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

101 Database Exercises Text Workbook

Authors: McGraw-Hill

2nd Edition

0028007484, 978-0028007489

More Books

Students also viewed these Databases questions

Question

Evaluate r 2 s 2 if and r = b + b - 4ac

Answered: 1 week ago

Question

How do i calculate the beta?

Answered: 1 week ago

Question

Describe the seven standard parts of a letter.

Answered: 1 week ago

Question

Explain how to develop effective Internet-based messages.

Answered: 1 week ago

Question

Identify the advantages and disadvantages of written messages.

Answered: 1 week ago