i was reading and writing from/to a binary file iwas making tellp() as a check
when i find that at some times it gives me -1 so what does it mean?
and by the way iwas using more than one object of ifstream and ofstream
for the same program is this may be the problem??
the code is just very big(176 lines) that i don't think writing it would be that efficient.
a return value of -1 by tellp() probably means that file stream is not open. you'll have to makes sure that:
-you pass the file name to the stream's constructor
-or if you don't want to pass the file name to the constructor explicitly call open with the filename on the stream.
If that still doesn't work check that you don't have multiple streams trying to open the same file as only one stream can be associated with a file at any point in time. If multiple streams are accessing a file make sure that you close the stream to the file if you no longer need to stream before using another stream to open the file.