I am having trouble starting this program, but I'm sure if I get a little hint on a direction to take, I'll be good to go.
I want to create a program that has multiple threads that takes lines from a simple text file and puts it into a circular array with a fixed size of 10 data lines.
While doing this, I'll have another thread that gets a line from the circular array and writes that line to another text file.
My question is, how to set up this circular array that takes lines from a text file and adds these full lines into the array.
A simple line would be, "Hello World" or anything like that. So the circular array will have ten lines from the input file, waits til the other thread takes from the array, then keeps adding the lines until end of file.
Where should I begin? How do I implement this circular array, and how should I set up the input/output streams?
Thanks in advance for all your help!
NOTE: I believe this is similar to the producer/consumer program, but I am not sure.