in my .c file i have a struct atop of the program defined as follows:
with the initial function following it like so:Code:#define MAX 10 int curtab; static struct tab { int count; int use; } tab[MAX];
but I find I receive a Seg-Fault error atCode:int tab_create(int init_count) { int i; for(i=0; i < MAX; i++) { if(tab[i].use != 1) { tab[i].use = 1; /* true */ tab[i].count = init_count; curtab = i; i = MAX; /* break */ } } return (curtab); }Why does this occur?Code:if(tab[i].use != 1)