0

Alright so I have 2 strings, and a text file that has 2 lines, I want to get each line and place the contents of each line in each string.

This is what I have so far:

#include <fstream>

std::ifstream readfile;
readfile.open("text.txt");

std::string line1;
std::string line2;

Example of what the text file looks like:

this is line1
this is line2
Levitate
  • 1
  • 2

0 Answers0