SOLVED: Per the two responses about having a fixed size, i do have a private var for size of array.
Simple solution: while(i < rhs.size) or a for loop
I am getting an infinite loop from this code. In main I am inputting 1 2 3 4 5
The problem is the even after reading in all 5 int, the system is still waiting for more input. If I input another int, it will enter the loop again.
template <typename T>
istream& operator>> <>(istream& in, MyArray<T>& rhs)
{
int i = 0;
while(!in.eof()) //I tried: while(in >> rhs.theArray[i]) as well, no go
{
in >> rhs.theArray[i];
i++;
}
return in;
}