Need some help with errors in the code
hey, Im not good with this stuff. :) Im writing this program in C and it gives me some errors, and I cant figure out how to solve it when it gives me those errors:
compiler gives me this error:
/* your code goes here */
response = showMenu();
case 0: return; /* your code goes here */
case 1: count = inputWords(string words);
case 2: displayWords(int count,string words);
} /* end of switch */
} /* end of while */
} /*end main */
/*make this printf function complete to display the whole menu*/
printf(" Main Menu\n"
" 1. Input words\n"
" 2. Display words\n"
" 3. Search for an exact match\n"
" 4. Search for a partial match\n"
" 5. Calculate the average length\n"
" 0. Exit\n");
printf("\n Please enter a choice: ");
/* use a scanf here to read users response from keyboard */
int inputWords(string words)
FILE * ptr;
int count; /*declare and initialize the variable count*/
ptr = fopen("illini.txt","r");
/*copy the code for the loop as shown in lab10 instructions*/
while( EOF != fscanf(ptr,"%s", words[count]))
/* Remember to change this return statement below to actually return the value of count.*/
/* Also don't forget to update case 1: in main. */
void displayWords(int count,string words)
for(i=0; i < count ;++i)
I know in which lines is the problem, but i don't know how to fix it. I don't know what to do. any help would be appreciate it.
lab10.c: In function 'main':
lab10.c:19: error: expected expression before 'string'
lab10.c:21: error: expected expression before 'int'
lab10.c:21: error: too few arguments to function 'displayWords'