I think yoy should read the value from the file

Code:
int main () {
  string line;
  ifstream myfile ("example.txt");
  if (myfile.is_open())
  {
    while (! myfile.eof() )
    {
      getline (myfile,line);
      cout << line << endl;
    }
    myfile.close();
  }

if(line==value)
//value that you want to compare
  else cout << "Unable to open file"; 

  return 0;
}

Last edited by shabbir; 22Jul2008 at 13:47.. Reason: Code block