Does anyone know how to use an array of files? The array is defined as:
fstream F[10].
I have 10 temp files that I need to use but am not sure how to open these temp files or write to them. I have a counter to keep up with which file to write to:
F[Counter%5].
What I need to do is read 1000 records from a file, sort them, and write the 1st 1000 records to F[0], the next 1000 records to F[1]...etc. How would you open the array of files or write to the array of files? I have never worked with multiple files like this. Thanks for any help! :p
tat2dlady
0
Light Poster
Recommended Answers
Jump to Post>How would you open the array of files or write to the array of files?
Show us your code. What you're doing sounds very tricky and error prone. I'd like to make sure that you're doing it right.
All 2 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.