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:
Code:
#include <stdio.h>
#include <conio.h>
#include <string.h>
#include <windows.h>
main()
{
FILE *fp2;
char nword[15];
int c, num2;
printf("Enter a word:\t");
gets(nword);
c = strcmp(nword, "aba");
if (c == 0)
{
fp2 = fopen("def.txt", "r");
num2 = fgetc(fp2);
while(num2 != EOF)
{
do
{
Sleep(50);
putchar(num2);
}
while(((num2 = fgetc(fp2)) != '1') && ((num2 = fgetc(fp2)) == '\n'));
}
fclose(fp2);
}
getch();
}
thanks.