Subj : Help using ::tellp() and ::tellg(() To : borland.public.cpp.borlandcpp From : Maya Date : Wed Oct 15 2003 06:22 pm Hey folks! Here is my problem: When I retrieve the cursor position in a file for the next write/put, using 'std::fstream::tellp()', I get a value equal or greater than zero; which is what I am expecting. However, when retrieving the cursor position for the next read/get, using 'std::fstream::tellg()', I get a value equal or greater than -1; which not what I am expecting. This will illustrate the problem: My program has two variables 'next_read' and 'next_write'; after opening a file I retrieve the values from the file stream using '::tellg()' and '::tellp()' respectively. Later when the application needs to write its data, it first gets the next_write value; which would initially be zero, and stores the data there; this works just fine, but when the application needs to get data from the file it fails miserably I am assuming that the reason why the program fails to retrieve data is because the value returned by '::tellg()' is -1 and there is not data at that cursor position. Am I right? Can anyone enlighten me in regards to this matter? Thanks in advance .