Topic: Files and Streams
Codes discussed will be posted here. Write your conclusion
File name: "test.txt"
Code:
Andrew Miller 87.50 89 65.75 37 98.50
#include <iostream>
#include <fstream>
int main()
{
std::fstream file("text.txt");
std::string line;
while (std::getline(file, line)) {
std::cout << line << std::endl;
}
return 0;
}
Comments
Leave a comment