So I am trying to assign a string value to an object in an array.
The object code is:
typedef struct BiTreeData_ {
char* word;
int start_word_count;
int end_word_count;
int start_ranking;
int end_ranking;
} BiTreeData;
In my main I make an array of pointers to BiTreeData using:
BiTreeData **dataarray;
dataarray=(BiTreeData**)malloc(sizeof(BiTreeData*)*maintree.size);
I try to assign a value to one of the variables within the struct with:
int z = dataarray[i]->start_word_count;
The program crashes. Any help would be appreciated. Thank you.