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);
}

I just saw that I forgot getline:

while ( getline(File, Dummy, '\n'))
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.