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;
}