Answer to Question #209228 in C++ for kyle

Question #209228

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 




1
Expert's answer
2021-06-21T15:45:03-0400
#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;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS