Code:
printf("How many entries to define?\n");
scanf("%d",&num);
struct entry list[num];
First of all your code need a proper indentation. And in the above code while declaring an array your array size need to be const. something like this
Code:
struct entry list[10];
it cant depend on a variable. C standard.
Code:
void clear_buffer(void)
{
int ch;
while((ch=getchar()) != '\n' && ch != EOF);
}
use this function here
Code:
printf("Enter words\n");
j =0;
clear_buffer();
do
{
letter = getchar();
array[j] = letter;
++j;
This clears the input buffer. That u got avoid using scanf funtion. And the problemw which u where getting likely because of scanf.
Code:
printf("%s\n",list -> definition);
printf("Do you wish to make another entry(y/n)?");
scanf("%c",&answer);
}while(answer != 'n' && i < num); //end entire loop
and u got tocheck for boundry of the array. becuase C dosn't check for array boundries
ssharish2005