I have a quick question about including headers I'm in situation the I want to build 2 classes that both of them hold a pointer to the other class. Each of them is in different header. How can I including the headers in a way that I'll not get identifier error
Client.h
#ifndef CLIENT_H
#define CLIENT_H
#include "Viewable.h"
class Client{
Viewable *viewptr;
}
#endif
Viewable.h
#ifndef VIEWABLE_H
#define VIEWABLE_H
#include "Client.h"
class Client{
Client* client;
}
#endif
this code gives me identifier error coz there is double definition. I understand why, how can I avoid that error?