done some modifications to the code.
ive got this:
but im getting an error during compilation.
//program to count words in a user supplied string
char line ;
int wordcount(char line);
int numberOfWords = 0;
printf("Enter a line and I will count the number of words: ");
fgets(line, sizeof(line), stdin);
printf("There are %d words in the sentance.", wordcount(*line));
//this function takes in the sentance variable, counts to each space character defined as ' ' and prints out the number of times
//it saw the ' ' (space) character.
int wordcount(char line)
int index = 0;
for(index <= sizeof(line), line == ' ', ++line)
does anyone see what the compiler talking about?
C:\CODE>gcc -o wordcount wordcount.c
wordcount.c: In function `wordcount':
wordcount.c:23: error: syntax error before ')'