I have one file, I need to read that file and count no of times repeated specific word.
char line ;
//static const char filename = "file.txt";
FILE *file = fopen("file.txt", "r" );
if( file != NULL )
while((fgets(line, sizeof(line), file))!= NULL)
char* ret= strstr(text2, "SUCCESSFULLY");
fclose ( file );
//perror ( filename );
fputs("There was an error reading the file.\n", stderr);
In this program where it is wrong not understanding. could u please resolve.