0

I am trying to read lines from a .txt file and put them to a vector like this but when I run the program, the computer get stuck.
The file is only about 50 lines.
I wonder what could be wrong with this code.

ifstream File("C:\\Gli\\temp\\File1.txt");
std::vector<string> For;
std::string Dummy;
				
while ( File, Dummy, '\n')
{
					
	For.push_back(Dummy);
}
1
Contributor
1
Reply
2
Views
10 Years
Discussion Span
Last Post by Jennifer84
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.