search for a string in a text file in c++

Anyone can teach how to search a data in a text file?

string line;
string id;
fstream file;
file.open("administrator.txt");

cin.ignore();
cout<<"Enter ID number: ";
getline(cin, id);

if(file.is_open())
{
while ( file.good() )
{

what should i put for my statement?


}

}
file.close();
system("PAUSE");
}
Topic archived. No new replies allowed.