Hi
I was implementing BFS and DFS
So I have three class stack,queue,nod e and main class
I have put Node class in Node.h
I #include"node.h " in both stack and queue headers..
Now when I #include"stack. h" and #include"queue. h" I got an error multiple definition of enuf status. I know the reason that it is defined twice
1) node of stack
2) node of queue
Whats the possible solution to avoid this???Please help...
I was implementing BFS and DFS
So I have three class stack,queue,nod e and main class
I have put Node class in Node.h
Code:
#define SIZE_NEIGHBOURS 10
#define SIZE_GRAPH 100
#include<iostream>
enum STATUS{ready=0,waiting=1,processed=2};
class Node
{
public:
char info;
int distance;
STATUS node_status;
Node *adjacent[SIZE_NEIGHBOURS];
Node *next;
Node()
{
// cout<<"Hui";
info=0;
distance=0;
next=NULL;
node_status=ready;
for(int i=0;i<SIZE_NEIGHBOURS;i++)
adjacent[i]=NULL;
}
};
Now when I #include"stack. h" and #include"queue. h" I got an error multiple definition of enuf status. I know the reason that it is defined twice
1) node of stack
2) node of queue
Whats the possible solution to avoid this???Please help...
Comment