Details of this Paper

overloaded assignment operator lab6_ex2_copy_operator_starter

Description

solution


Question

Question;Add an overloaded assignment operator, a copy constructor to the Cube class, and a printCube member function in the attached lab6_ex2_copy_operator_starter.cpp. This starter is incomplete, you have to fill the right stuff in the blank in order to compile correctly.This copy constructor should accept a Cube object as an argument. The constructor should assign to the Cube attribute (width, length and height) the value in the arguments Cube attribute. As a result, the new object will be a copy of the argument object.starter.cpp is#include #include using namespace std,class Cube{private:int width, length, height,public:Cube() {}Cube(const Cube &c){cout<<"Copy constructor called "<

 

Paper#36829 | Written in 18-Jul-2015

Price : $22
SiteLock