Thanks for the help - my output is still getting stripped of its whitespace, though - as in, I want to output the text file such that it retains all of the original whitespace of whatever was in the file.
The reason your code segfaults is that your "certain file" almost certainly has input that will overrun your 100-byte buffer. One should not use stream operators with fixed size buffers. That C++ even allows it is a language defect IMO. Use read() with fixed size buffers.