void freeArray(int ***a) {
int i,j;
for(i = 0; i <=NUMBER_OF_STUDETS; i++){
for(j = 0; j <= NUMBER_OF_CLASSES; j++){
free(a[i][j]);
}
free(a[i]);
}
free(a);
Type: Posts; User: Sorinx
void freeArray(int ***a) {
int i,j;
for(i = 0; i <=NUMBER_OF_STUDETS; i++){
for(j = 0; j <= NUMBER_OF_CLASSES; j++){
free(a[i][j]);
}
free(a[i]);
}
free(a);
Nah just commenting on my own stupidity, but I'm literally falling asleep, looking at free function now. never did much with malloc prior
Lol, wow is all I can say. I know better than this
Ahh yes, I noticed that and changed it, I can enter the inputs, but then afterwards it crashes.
Bare with me I'm a bit over tired, why am I out of bounds?
Ahh sorry, I edit it in main, whenever I respond about the changes!
Thanks I missed that semi colon, it's early and my spacing is horrid atm, bad habits. Still same result however
Ok I wrote a function to free my memory, and I won't cast it in the future. Trying to figure out what I am doing wrong
what should I do instead of casting malloc?
Just crashes when I try and run
Clearly I'm not doing this right, what am I missing?
/* printing the average grade for every student in every class.
printing out the average grade per class; printing out the average grade...