Skip to main content
GameDev.net gamedev.net
🔒 Locked

ifstream

Started by Crispy Aug 30, 2003 at 4:43 AM 0 replies 300+ views
Original Post
Crispy
Crispy
I recently upgraded from BC5.02 to BCB6.0 and am currently importing an old project of mine. Yesterday, when I was going over some file parsing code, I came across something I can''t really understand. Namely, I''m using ifstream.getline(buf, size, delimiter) to read lines from a binary file up to either a newline or a carriage return. It took me hours to get it working with carriage return as the delimiter as ifstream.tellg() was constantly returning -1. The delimiter is decided upon by parsing the beginning of the file, so there''s no way of knowing in advance which one should be used. When extracting up to a newline, however, ifstream.tellg() is now returning -152 after the call (which seems to be successful and the returned buffer seems to be OK), which is a bit unexpected as 1) this didn''t use to happen before, 2) failbit is not set, 3) I have no clue what -152 means and neither has Google. Ideas? Cheers
"Literally, it means that Bob is everything you can think of, but not dead; i.e., Bob is a purple-spotted, yellow-striped bumblebee/dragon/pterodactyl hybrid with a voracious addiction to Twix candy bars, but not dead."- kSquared

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.