Skip to main content

beware of stream programming!

if you ever plan to do cross platform programming in c++, avoid streams like hell, i tell you! 

positioning inside streams, copying of streams, readbuf methods, calculating offsets.... some of these methods behave different on linux(32bit), linux(64bit) and windows(32bit), breaking your code big time. 
i made the mistake to use them in the current project. but i wouldnt any more.

easy example: create some instances of different streams, write some data into the streams, then check what in_avail() tells you. make the same on windows and linux, and already you can get different results. 
maybe later on i will post some example code.

bytes

Comments