Wow, it works perfectly (and I think I actually understand it). Why do I have to use a pointer to the streambuffer though? Does the streambuffer exist in a special part of memory or something? I've read in my C++ book that you can only access certain parts of memory using pointers. Thanks for all the help Corned Bee.