Your buffer is on the stack. In this case it is the same, if you constructed the streams from different places, it would be different. Note that this is is a terrible thing to do. That memory will be used to store local variables and etc., so you won't know what's in there. You should use dynamic memory here. If you want the buffer to be shared, you can make it a static member of the class.