I have a struct in struct array inside another struct array and need to access values in this struct.
typedef struct unit
{
bool isNot;
char letter;
} unit;
typedef struct line
{
unit *clause;
int lineLength;
} line;
typedef struct fullData
{
line **table;
} fullData;
I am trying to access a unit struct i have created like so:
struct fullData Block;
struct Line lines;
and then to access:
Block.table[i][j].letter
to get the letter in the unit struct.
This is kinda abridged, but the 2d array is massively populated.
Block.table[i][j].clause[z].letterwherezis the unit index you are trying to access.Block.table[i]->clause->letterthen.table[i]is aline *so you dereference it with->to get aline. Same logic for clause, which is aunit *and you have to dereference using the->.