well, that's much of the code so far.. it checks wheter the user inputted the correct string by comparing the words of each strings.. it also compiled but it crashes everytime i run the program.. is there anything wrong?Code:int main() { char text1[SIZE] = {"The quick brown fox jumps over the lazy dog."}; printf("The quick brown fox jumps over the lazy dog\n"); printf("Input the text above:\n"); gets(input); check(input, text1); printf("Score: %g\n", score); } void check(char input[], char text[]) { for (i=0; i<SIZE; i++) for (j=0; j<SIZE; j++) { words[i][j] = '\0'; cwords[i][j] = '\0'; } for (c=0, i=0, j=0; input[c] != '\0'; c++, j++) { if (input[c] == ' ') { words[i][j] = '\0'; c++; i++; if (i>=10) i=0; j=0; } words[i][j] = input[c]; } for (c=0, i=0, j=0; text[c] != '\0'; c++, j++) { if (text[c] == ' ') { cwords[i][j] = '\0'; c++; i++; if (i>=10) i=0; j=0; } cwords[i][j] = text[c]; } for (c=0, score=0; words[c] != '\0'; c++) if (strcmp(words[c], cwords[c])==0) score++; }
Thanks!