This is my code right now, int main(int argc, const char * argv[]) { cout << \"*
ID: 3651657 • Letter: T
Question
This is my code right now,int main(int argc, const char * argv[])
{
cout << "** Name Popularity Program **" << endl << endl;
cout << "Please enter a first name to search for: ";
string FN;
cin >> FN;
ifstream file;
file.open("/Users/grahamarthur/Desktop/NamePopularity/firstnames-mac.txt");
if (file.is_open())
{
while (!file.eof())
{
string R;
getline(file,R);
string name;
string FNinR;
FNinR = R.substr(...);
}
}
return 0;
}
the issue i have right now is that i cannot retrieve the first name in each string R to place into new string variable FNinR. I need to search a file for a name, so i go line by line to extract the name and compare to the input. If they are equal they will output a result, the whole string line. But i cannot compare the imput to the name in the string !!