tellg After Reading
easyQuestion 651The program below writes the eleven characters hello world (no newline) into words.txt, then opens it for reading with an fstream. Complete it so that it reads one word from the file with >> and then prints the current read position, cast to long, in the form Position: N followed by a newline.
The program must print exactly the output shown in Expected Output.
Expected output
Position: 5= newline. The output ends with a newline, so print one after the last line.
Hints2 available
Sign in to use hintsTopics
Streamsfstream
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (cout, fori)
Your output
Run your code to see the output here...
Test cases
Run your code to see test case results.