Can somebody gimme a hand with this. I really have no clue why this thing is throwin errors. I don't know if I just don't get it or if I put something out of place....
my declaration is as so:
Code:
IntArray operator+(const IntArray& rhs);
Here's the function:
Code:
//sum of two arrays to be assigned to a third
IntArray IntArray::operator+(const IntArray& rhs)
{
////////////////////////////////////////////
// real code
//////////////////////////////////////////
int i, j, k;
//TODO:Reverse this check
// if (size1 != size1)
// return NULL;
if(rhs.size() != size())
{
cout<<"Arrays are not the same size" << endl;
}
else
{
m_size = rhs.size();
temp = new int[m_size];
//TODO: change this size - check off by one.... see operator=...
for(i=temp.low(), j = low(), k = rhs.low(); i <= high(); i++, j++, k++)
{
temp[i] = m_array[j] + rhs[k];
}
return temp;
}
}
I'm getting the following errors: c:\documents and settings\hp_administrator\my documents\visual studio 2005\projects\overloadlab\intarray.cpp(106) : error C2511: 'IntArray IntArray:perator +(IntArray)' : overloaded member function not found in 'IntArray'
c:\documents and settings\hp_administrator\my documents\visual studio 2005\projects\overloadlab\intarray.h(4) : see declaration of 'IntArray'