5,337
edits
(→Thread) |
|||
Line 127: | Line 127: | ||
std::istream my_file("my_file.txt"); | std::istream my_file("my_file.txt"); | ||
std::string line; | std::string line; | ||
// Read line by line | |||
// You can also read using << | |||
while (getline(my_file, line)) { | while (getline(my_file, line)) { | ||
std::cout << line << std::endl; | std::cout << line << std::endl; |