Okay I have some typedefs like:
typedef struct {
int validBit
int pageNumber
} PT_ENTRY;
typedef struct {
PT_ENTRY entry[128];
} PT;
Later on in the code, I attempt:
PT pt = {};
int i;
for(i=0;i<128;i++){
pt.entry[i] = malloc(sizeof(PT_ENTRY));
}
This gives me the error:
Incompatible types in assignment.
So I'm confused, because I thought I did this exact same thing yesterday and it worked, then I changed my code but decided to change it back.
Isn't pt.entry an array of pointers? What am I missing here?
Or better yet, what's the best and fastest way to create this struct PT containing an array of 128 structs, PT_ENTRY?