I have something done very easily in Java, but what is the C++ version of the following:
while (in.hasNextLine())
{
String line = in.nextLine();
if (i == 13)
{
i++;
break;
}
i++;
}
It's the nextLine parts I can't seem to find a C++ equivalent for
std::ifstream in("Path\\To\\File.txt");
std::string line;
while (std::getline(in, line))
{
if (i++ == 13)
{
break;
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With