Question: a) Transform the following class into a class template and then answer questions b to e. b) Write the code for the == operator for

a) Transform the following class into a class template and then answer questions b to e.

class Array ( public: Array ( int - 10 ); Array( Array

b) Write the code for the == operator for your class template.

c) Write the code for the != operator. Make sure it calls operator ==

d) Write the code of the copy constructor.

e) Show how you would create an array of 10 double variables.

class Array ( public: Array ( int - 10 ); Array( Array & ); -Array (); int getSize (); Array & operator =( Array & ); bool operator=( Array & ); bool operator!=( Array &); int &operator[] ( int ); int operator[)( int ); private: int size; int *ptr; };

Step by Step Solution

3.33 Rating (159 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To transform the given class into a class template and address the questions follow these steps a Tr... View full answer

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 Programming Questions!