Hello all,
I want to write a program that uses multiple threads that does the following:
Opens a simple text file containing AT LEAST 500 KB of data
a reads a line of the file into a “buffer” (a “circular” array with fixed size = 10 data lines)
b when “end of file” is detected, puts a “special code” in the buffer
c continues reading until the buffer is full or waits for an indication that there is space in the buffer, then continues reading.
I'm very confused on how to create a "buffer." Any help?
Also, I want to implement this to:
a get a line from the buffer and writes a line of the file to a file
b exits when a special code is in the buffer.
c repeats the previous steps (a, b) as long as there is data in the buffer, waits if the buffer is empty
Any help will be greatly appreciated. I'm new at C++ programming, and am very interested in seeing this program work!! Thank you all for your help.