Subj : Problems with tellg() To : borland.public.cpp.borlandcpp From : Maya Date : Thu Oct 23 2003 03:28 pm I am not sure if the problem below is a bug or an error on my part, but after reading data from a file I check the file cursor position using ::tellg() and tellp() and I get -1; an error in the stream. ---- snip ---- bool data; fstream f(blabla, blabla) std::cout << f.tellg() << std::endl; //<--- returns 0 f >> data; std::cout << f.tellg() << std::endl; //<--- returns -1 ----- The data stored in 'blabla' is '010101', all bool values. If I only read the first value in the file (zero) why is tellg() reporting a failure in the stream. A more comprehensive example is at: http://www.vif.com/users/escalante/IO_BASE_H.html Can anyone help? -- Jorge Escalante FYI http://www.astro.umd.edu/~marshall/abbrev.html E-Mail Policy http://www.vif.com/users/escalante/Email_Policy.html * You cannot exercise your power to a point of humiliation. - Jean Chretien * The media's the most powerful entity on earth. They have the power to make the innocent guilty and to make the guilty innocent, and that's power. - Malcom X * "Innocent until proven guilty", no... not in Canada!! .