logo CodeStepByStep logo

streamErrors

Language/Type: C++ streams file input
Related Links:

Suppose an input file named streamErrors-data.txt contains the following text:

Donald Knuth
M
76
Stanford U.

The code below attempts to read the data from the file, but each section has a bug. Correct the code and submit a version that reads the code and prints the values expected as indicated in the comments.

Bare code. Write a fragment of C++ code as described, without any main function or heading around your code.

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.