If I had a structure like this
typedef struct {
char word[101];
int freq;
char filename[100];
} WordArray;
and declared this inside a method instead of it being a global variable(so its local)
WordArray words[10000];
then how would I allocate memory to this?
I've had this
for (i=0;i<10000;i++)
{
words[i] = (*WordArray)malloc(sizeof(WordArray));
}
And fooled around with it but, got nothin. Suggestions?