rendered paste bodyg++ -o stack stack.cpp
In file included from stack.cpp:2:
stack.h:8: error: field `NextNode' has incomplete type
stack.cpp: In constructor `Node::Node(int, Node&)':
stack.cpp:13: error: `NextNode' was not declared in this scope
make: *** [stack] Error 1
\\ stack.h
class Node
{
public:
Node(int data, Node& next);
int getData() const;
private:
int NodeData;
Node NextNode;
};
class Stack
{
public:
Stack ();
bool isEmpty();
void push(Node next);
Node& pop();
private:
Node HeadNode;
};
\\stack.cpp
#include <iostream>
#include "stack.h"
int main(){
std::cout << "Initializing" << std::endl;
return 0;
}
Node::Node(int data, Node& next)
{
NodeData = data;
NextNode = next;
}
int Node::getData() const
{
return NodeData;
}