I have been working on this program forever and I have to hand it in soon. Here is what I have gotten so far that is correct. I really don't know how to copy the queue. I know I have to use a for loop but I don't know how to access it. If anyone could help I would really appriciate it.
#include <stdlib.h>
//#include <stdlib.h>
#include <iostream.h>
class queue {
public:
// constructors and destructors
queue() //default constructor
{
frontptr = NULL;
backptr = NULL;
}
queue(const queue& aqueue) //copy constructor
{
}
~queue() //destructor
{
}
// queue operations:
void create_first_node()
{
frontptr = new Node;
frontptr->item = 2;
frontptr->next = NULL;
backptr = frontptr;
}
void create_remaining_nodes()
{
}
//private:
struct Node //a node on the queue
{
int item; //a data item on the queue
Node *next; //pointer to next node
}; // end struct
Node *frontptr; //pointer to front of queue
Node *backptr; //pointer to back of queue
Node *newptr; //pointer to new Node
}; //end class
void main()
{
queue Aqueue;
Aqueue.create_first_node();
cout <<"this is a test" << endl;
}
please I don't know what do I really need help
#include <stdlib.h>
//#include <stdlib.h>
#include <iostream.h>
class queue {
public:
// constructors and destructors
queue() //default constructor
{
frontptr = NULL;
backptr = NULL;
}
queue(const queue& aqueue) //copy constructor
{
}
~queue() //destructor
{
}
// queue operations:
void create_first_node()
{
frontptr = new Node;
frontptr->item = 2;
frontptr->next = NULL;
backptr = frontptr;
}
void create_remaining_nodes()
{
}
//private:
struct Node //a node on the queue
{
int item; //a data item on the queue
Node *next; //pointer to next node
}; // end struct
Node *frontptr; //pointer to front of queue
Node *backptr; //pointer to back of queue
Node *newptr; //pointer to new Node
}; //end class
void main()
{
queue Aqueue;
Aqueue.create_first_node();
cout <<"this is a test" << endl;
}
please I don't know what do I really need help