thanks for those who helped me.
i have another problem but this time i have an output but incorrect character.
i have a text file(note pad) containing this sentence:
"stay extending from ship's mastheads to the side of the ship" but the result is incorrect.
this is my code:
int c, num2;
printf("Enter a word:\t");
c = strcmp(nword, "aba");
if (c == 0)
fp2 = fopen("def.txt", "r");
num2 = fgetc(fp2);
while(num2 != EOF)
while(((num2 = fgetc(fp2)) != '1') && ((num2 = fgetc(fp2)) == '\n'));