Question
I have both header files for a queue of nodes. What would the cpp files look like? #ifndef NODE_H #define NODE_H using namespace std; class
I have both header files for a queue of nodes. What would the cpp files look like?
#ifndef NODE_H
#define NODE_H
using namespace std;
class Node {
private:
string m_entry;
Node* m_next;
public:
Node(string entry);
string getEntry() const;
void setEntry(string entry);
Node* getNext() const;
void setNext(Node* next);
}; #endif
#ifndef QUEUE_H
#define QUEUE_H
#include "node.h"
using namespace std;
class Queue {
private:
Node* m_front;
Node* m_back;
public:
Queue();
Queue(const Queue& orig);
~Queue();
void operator=(const Queue& rhs);
bool qIsEmpty() const;
void enqueue(const string entry);
void dequeue();
string peekFront() const;
}; #endif
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started