The question is simple, I guess I cannot do this: (Im in the header file)
typedef struct {
myclass *p;
...
} mystruct;
class myclass {
private:
mystruct *s;
...
}
Because when the compiler reaches the struct it doesnt know what myclass is, but I cannot do the reverse either for the same reason:
class myclass {
private:
mystruct *s;
...
}
typedef struct {
myclass *p;
...
} mystruct;
How can I make that possible ? Im guessing there is some way to say the compiler "There is an struct called mystruct" before the class (2 example) so it knows that mystruct *s it's possible but I cant manage to do it right. Thanks
typedef struct { ...} xyz;In clean C++ you writestruct xyz { ...};and the type is defined...