What is the best and shortest way to code these classes without compiler error
"field 'image' has incomplete type Image image;"
struct ImageFrame {
Image image;
};
struct Image {
ImageFrame imageFrame;
};
I have tried putting
struct ImageFrame;
struct Image;
before, but error still occurs, even if the order of anything is changed.
EDIT: Using reference it works like this:
struct ImageFrame;
struct Image;
struct ImageFrame {
Image* image;
};
struct Image {
ImageFrame imageFrame;
};
Are there any memory issues at "Image* image" I should take care of? (memory leaks if *image not deleted)