So I have a structure of unknown size as follows:
typedef struct a{
int id;
char *name;
enum job {builder=0, banker, baker};
} person;
person p;
and I want to count how many entries are in the struct through some sort of loop. I'm sure this is very simple and I'm just not thinking about it correctly but I can't seem to figure out how I would this without knowing its size.
So presumably I can't use:
for(i=0; i<x; i++) //where x is the size of the struct
{
if(p.id!=0)
count++;
}
what am i missing here?