delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/08/21/16:38:09

From: user AT cinema06 DOT us DOT es (user)
Subject: B19: problem with istream::tellg() under Win95
21 Aug 1998 16:38:09 -0700 :
Message-ID: <35DD417C.3F26.cygnus.gnu-win32@post.rwth-aachen.de>
Reply-To: boris DOT holscher AT post DOT rwth-aachen DOT de
Mime-Version: 1.0
To: gnu-win32 AT cygnus DOT com

Hi,

The call of istream::tellg() on an input file stream causes a move of
the actual reading position. This seems to happen in connection with the
use of istream::get(char).

Test program:------------------------------------------------------
#include<fstream.h>

void main()
{
  ifstream fileS("mbinput.txt");
  char c;
  streampos pos;
  while (fileS)
    {
      fileS.get(c);
      if (c=='=') {pos=fileS.tellg();};
      cout << c;
    };
  cin >> c;
}

-------------------------------------------------------------
On the first ocurrence of '=' in "mbinput.txt" the current read position
jumps forwards some characters. Is this a bug?

Thanks for help (if possible as email to me)

Boris.
-
boris DOT holscher AT post DOT rwth-aachen DOT de
boris AT esi DOT us DOT es - www.esi.us.es/~boris
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019