constchar* const path = "inferno.txt" ;
constchar* const the_word = "the" ;
// the constructor opens the file, and the destructor will close it
std::ifstream fin(path) ;
int count = 0 ;
// you have #include <string>, why not use std::string
std::string this_word ;
// while(!fin.eof()) // this is a wrong idiom
// instead, check for success *after* the attempted input
while( fin >> this_word )
// convert this word to all lower case
for( char& c : this_word ) // for each character in this word
c = std::tolower(c) ; // http://en.cppreference.com/w/cpp/string/byte/tolowerif( this_word == the_word ) // std::string is EqualityComparable
std::cout << count << '\n' ;
> Yea, and it looks like he's not gonna update his compiler anytime soon.
> Maybe because his institution still insists Turbo or something like that.
You have absolutely no evidence to conclude either that hkrishnan81 is not using a current compiler or that if he were using one, he would be averse to moving to a later version. Or for that matter, that his institution 'still insists Turbo or something like that'.