Hi guys,
I am working on a program for my c class and I was wondering anyone knows if it is possible to define a structure that has dynamic members. I think I saw a thread on this already but when I read it, it didn't quite make sense. This is what I am trying to find a way to do.
typedef struct{
char x;
char firstName[50];
char lastName[50];
int n;
char phoneNumber[7]; (the amount of phone #'s times n)(so if n is 3, 3 phone #'s)
} entry;
I really have no idea on how to do this. When I looked around for tutorials and such I couldn't really find anything relevant. I figure I could accomplish the same thing almost by just setting phoneNumber[100] and putting a space in between each but that would be worst case scenario.
Thanks for taking a look at this.