Course Solutions Uncategorized (Solved) : Implement Class Smartarray Class Template Elemtype Accept Numerical Value Code Issues Unab Q28127289 . . . .

(Solved) : Implement Class Smartarray Class Template Elemtype Accept Numerical Value Code Issues Unab Q28127289 . . . .

 

How do i implement the class smartArray, as a class templateelemtype to accept any numerical value.

Below is code i have issues , in being unable to make theostream and istream work for the template

template <class elemType>
class smartArray{
friend   ostream& operator<<(ostream&,const elemType &);    // i have issueswith this
friend istream& operator>>(istream &, elemType &);              // issues with making this work as template
public:
elemType *elements; // dynamic array, memory is allocated inthe
// constructor. Use *this to access size member.
int length(); // returns the length of the array
smartArray(); // default constructor, sets size to 0
smartArray(int size); // constructor, allocates the memory for*elements, if size==0, then no memory

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post