I started my first big c++ project, in which I divided the functionality of the program into different files. I ran in a situation where library include each other and there was some declaration problem.
sometingh like this:
in apha.h
#pagma once
#include "betha.h"
struct alpha
{
int data;
betha bb;
};
int fun1(apha a);
in betha.h
#pagma once
#include "alpha.h"
struct betha
{
double data;
double moreData;
};
int fun2(alpha a, betha b);
I found a solution in transferring all the struct in a separate file struct.h and it works fine. but I was wondering if there was a way to have the struct in their respective libraries because it would make more sense and be easier to work with.