help searching text file !

The question is how i search for the name , in order to obtain all the information?

my txt file in include
id
name
ic
gender
dob

#include <iostream>
#include <fstream>
#include <string>
using namespace std;

int main () {
string line;
ifstream myfile ("example.txt");

cout<<"Enter Name: ";
getline(cin,Name);

if (myfile.is_open())
{
while (! myfile.eof() )
{
getline (myfile,line);
if (line = name)
{
// read next line and print it... but how?
}
myfile.close();
}

else cout << "Unable to open file";

return 0;
}

output:
id
name
ic
gender
dob
Topic archived. No new replies allowed.