Ethan O.

asked • 02/19/20

What is the output of the code segment below? Assume all necessary libraries have been included.

fstream train;

train.open("TTR_Rules.txt", ios::in|ios::out);

char ch;

train.seekp(10, ios::beg);

train.seekg(-2, ios::cur);

train.seekp(10 + train.tellg() - 3);

train.get(ch);

cout << ch;

The contents of the file (TTR_Rules.txt) are as follows. There are no new line characters in the file.

Ticket to Ride is a cross-country train adventure. Players compete to connect different cities by laying claim to railway routes on a map of North America.

a) i
b) a
c) s
d) n



1 Expert Answer

By:

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.