Cna anyone point me in the right direction, I have a struture in my .h
file:
typedef struct mdata
{
int names[500];
int dates[500];
int ages[500];
}m_Data;
and in my .c file I declare a pointer to this strucutre and put aside
memory to hold it:
m_Data* firstlist;
firstlist = (m_Data*)malloc(sizeof(m_Data));
What I'm wondering about it is if there is a way that I can change each
of the elements from being a fixed size of 500 to a being user defined
size? I'm guessing I can make the elements pointers but do I use malloc
on each of the elemnnts, and if so isn't that changing the size of the
struture in which I have already put aside an initial memory of
'malloc(sizeof(m_data))'. As you can see I'm a little confused, any
ideas?
regards,
Rory.