I am working on a small program that is simply supposed to take a text file and copy it. My assignment states that I am supposed to be using a character buffer during this, but I'm not really sure why.
Is it simply because we will not always be able to allocate enough space for a file of arbitrary size? The text file I'm copying is tiny, but for this to work in general, it should have a buffer? If so, is it intended that I simply allocate a certain amount of the file into the buffer, copy it over to the new file, then go back and grab the next bit of the original file, and repeat?
I think this sounds right. If so, how does one determine an appropriate buffer size?