Tracing of abstract array - c++ program, C/C++ Programming

Tracing of Abstract array:

inline int isZero( const Object& o )

{

    return o == NOOBJECT;

}

 

int AbstractArray::isEqual( const Object& obj ) const

{

    PRECONDITION( isA() == obj.isA() );

    AbstractArray& test = (AbstractArray&)obj;

    if( lowerBound() != test.lowerBound() ||

        upperBound() != test.upperBound()

      )

        return 0;

 

    ContainerIterator& iter1 = initIterator();

    ContainerIterator& iter2 = test.initIterator();

    while( iter1 && iter2 )

        if( iter1.current() != iter2.current() )

            {

            delete &iter1;

            delete &iter2;

            return 0;

            }

        else

            {

            iter1++;

            iter2++;

            }

 

    delete &iter1;

    delete &iter2;

    return 1;

}

 

void AbstractArray::printContentsOn( ostream& outputStream ) const

{

    ContainerIterator& printIterator = initIterator();

    printHeader( outputStream );

    while( printIterator != 0 )

        {

        Object& arrayObject = printIterator++;

        if( arrayObject != NOOBJECT )

            {

            arrayObject.printOn( outputStream );

            if( printIterator != 0 )

                printSeparator( outputStream );

            else

                break;

            }

        }

    printTrailer( outputStream );

    delete &printIterator;

}

 

 

 

Posted Date: 10/18/2012 6:18:55 AM | Location : United States







Related Discussions:- Tracing of abstract array - c++ program, Assignment Help, Ask Question on Tracing of abstract array - c++ program, Get Answer, Expert's Help, Tracing of abstract array - c++ program Discussions

Write discussion on Tracing of abstract array - c++ program
Your posts are moderated
Related Questions
Project Description: I want an experienced programmer to program an RFID tag that will be read (maybe also written), and perform a call to a Filmmaker Pro 13 database. Skills

Prepare aime crossover alert expert adviso Project Description: Need to develop an expert advisor base on aime crossover alert indicator. Skills required is C Programming


Project Description: I want a script for an online poker site. It needs to be scanning all the required tables and when the table meets certain criteria it should take a seat at

A string is said to be "Beautiful"€, if it contains only non repetitive alphabets

Explain about Evaluation of Expression in c language? An Expressions are evaluated using an assignment statement of the form: variable = expression; The Variable is any v

How to use HTTP Headers inside PHP? Write the statement through which it can be added? HTTP headers can be used in PHP by redirection that is written as: Headers can be

Algorithm for railway ticket booking process

Define How Passing Arrays to a Function? A complete array can be passed to a function as an argument. The manner in which the array is passed be different from that of an ordin

What are header files? What are their uses? - Header files are also known as library files. - They carry two significant things: definitions and prototypes of functions bein