Help! implement a copy constructor ADT queue in C++

  • Thread starter Thread starter ecestd
  • Start date Start date
E

ecestd

how do you implement a copy constructor for this pointer-based ADT
queue
#include "Queuep.h"
#include <cassert>
#include <new>
using namespace std;

Queue::Queue () : backPtr (0), frontPtr(0)
{
}
Queue::Queue(const Queue& Q) throw(OutOfStorageException)
{
//implement here
}//end copy constructor

Queue::~Queue()
{
while ( !isEmpty() )
{
dequeue();

}//end while
}//end destructor
assert( (backPtr == 0) && (frontPtr == 0) )
 
ecestd said:
how do you implement a copy constructor for this pointer-based ADT
queue
#include "Queuep.h"
#include <cassert>
#include <new>
using namespace std;

Queue::Queue () : backPtr (0), frontPtr(0)
{
}
Queue::Queue(const Queue& Q) throw(OutOfStorageException)
{
//implement here
}//end copy constructor

Queue::~Queue()
{
while ( !isEmpty() )
{
dequeue();

}//end while
}//end destructor
assert( (backPtr == 0) && (frontPtr == 0) )

You may get better answer in a C++ group.

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top