cout << "Please enter the name of a project: ";
cin >> name;
ifstream file ("project.txt");
if (file.is_open())
{
while(file.good())
{
file >> name;
getline (file, name);
cout << name;
}
file.close();
}
Why is it displaying the whole text file?
By the way here is a example of the text file
"project 1"
Bob
Mike
"project 2"
Jay
Homer
Thanks.

New Topic/Question
Reply



MultiQuote





|