while(feof(fptr)==0){ char * result; char line[100]; result = fgets( line, sizeof( line ), fptr ); if ( result == NULL ){ break; } line[strcspn( line, "\n" ) ] = '\0'; token = strtok(line," \t,:;\'\"\?!-_|\\><~@#$%^&*()+{}[].=1234567890"); while( token != NULL ) { printf( " %s\n", token ); if(strcasecmp(token,word)==0){ count++; //counts the number of occurrence of the word } token = strtok(NULL," \t,:;\'\"\?!-_|\\><~@#$%^&*()+{}[].=1234567890"); } }
fseek/ftell
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)