I will try to describe my problem as best in English first starting from the top:
This starts with a structure named 't' which there needs to be 6 of (this never changes), which contains some simple variables - but also needs to contain an array of structures called 'p' which there needs to be 4 of per 't' object. 'p' will contain some further simple variables followed by a further array of structures called 'f' which will then finally just contain some simple variables.
See code below for how I would attempt this problem:
struct t
{
//some simple variables here
struct p pts[4]; //will always contain 4 elements/objects
};
struct p
{
//more simple variables here
struct f fbs[X]; // x can be any value between 1-4
};
struct f
{
//finally some more simple variables
};
To start off I am just trying to use:
struct p
{
//more simple variables here
struct f fbs[X]; // x can be any value between 1-4
};
struct f
{
//finally some more simple variables
};
To get started. However anytime I try and put an array of structures of 'f' or just a single structure 'f' I get an error: "exit status 1 - field 'fbr' has incomplete type 'f'"
Unless I initialize it within 'p' as:
struct f;
Which is not what I want. Any advice / help would be appreciated. Can't seem to find anything understandable online regarding this. I understand it may be to to with memory allocation but am not 100% sure.
Thanks in advance