mike
mike

Reputation: 75

Several input streams vs one input stream with seekg

I have a large (text) file that is divided into d "chunks". The user can read the next line from either of these chunks - the order is not specified. The file is not changed in the process.

There are two obvious solutions: Maintaining d input streams (one per chunk) or maintaining the current stream positions and jumping from chunk to chunk via the seekg-method with a single stream.

Is there any reason to assume that either method is (much) better than the other (in terms of efficiency)?

Upvotes: 0

Views: 47

Answers (0)

Related Questions