Homework/HW01/MyArray.cc
bool MyArray::operator==(MyArray &data) const
{
    //Declare a flag to keep track of whether the arrays match.  Assume that they do.
    bool arraysMatch = true;
    
    //Check to make sure the sizes match.  If they do not, set the arraysMatch flag to false.  This
    //will prevent the following for loop from triggering.
    if (size != data.size)
        arraysMatch = false;

    //Cycle through the elements of the arrays and test if they match.  If they do not, set the
    //arraysMatch flag to false, which will exit the for loop.
    for (int i = 0; i < size && arraysMatch; ++i)
        if (array[i] != data.array[i])
            arraysMatch = false;

    //Return the arraysMatch flag
    return arraysMatch;
}
/****************************** operator== *********************************************************
Action:         Compares one MyArray object with another and decide if they are equal. Objects of
                differing sizes are always considered not equal.

Parameters:
IN:             MyArray &data, contains a reference to the MyArray object being compared against.
OUT:            None

Returns:        bool, representing whether the calling object and the other object are equal.

Precondition:   None
***************************************************************************************************/
operator
Action:         Compares one MyArray object with another and decide if they are equal. Objects of
differing sizes are always considered not equal.

MyArray &data, contains a reference to the MyArray object being compared against.
OUT:            None

bool, representing whether the calling object and the other object are equal.

None
operator Action : Compares one MyArray object with another and decide if they are equal . Objects of differing sizes are always considered not equal . MyArray &data contains a reference to the MyArray object being compared against . OUT : None bool representing whether the calling object and the other object are equal . None
bool MyArray::operator==(MyArray &data) const
{
    bool arraysMatch = true;
    if (size != data.size)
        arraysMatch = false;
    for (int i = 0; i < size && arraysMatch; ++i)
        if (array[i] != data.array[i])
            arraysMatch = false;
    return arraysMatch;
}
bool MyArray :: operator == ( MyArray & data ) const { bool arraysMatch = true ; if ( size != data . size ) arraysMatch = false ; for ( int i = 0 ; i < size && arraysMatch ; ++ i ) if ( array [ i ] != data . array [ i ] ) arraysMatch = false ; return arraysMatch ; }
operator
Action:         Compares one MyArray object with another and decide if they are equal.
operator Action : Compares one MyArray object with another and decide if they are equal .
//Declare a flag to keep track of whether the arrays match.  Assume that they do. //Check to make sure the sizes match.  If they do not, set the arraysMatch flag to false.  This //will prevent the following for loop from triggering. //Cycle through the elements of the arrays and test if they match.  If they do not, set the //arraysMatch flag to false, which will exit the for loop. //Return the arraysMatch flag