I am working on this code:
struct box
{
char word[200][200];
char meaning[200][200];
int count;
};
struct root {
box *alphabets[26];
};
root *stem;
box *access;
void init(){
//cout<<"start";
for(int i = 0 ; i<= 25; i++){
struct box *temp =(struct box*)( malloc(sizeof(struct box)*100));
temp->count = 0;
cout<<temp->count;
stem->alphabets[i] = temp;
}
//cout<<" initialized";
}
It got compiled without errors, but during its execution it stops at the point where temp is allocated to stem->alphabets[i]. How to fix this?
stemis not initialized. Thus a crash. initializeaccesstoo.