int casting of tellp() - was giving error in OS X