This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Analysis of libstdc++/2071 test case


In article <20010509161235.A17645@alinoe.com>,
Carlo Wood <carlo@alinoe.com> writes:

> ~>a.out
> 1234
> 49 50 0

> An output of "1 2" seems highly unlikely, it should be "49 50 0".

Sorry about that, I posted a different version of the test case than
was used to produce the results I included.

Here was the exact version run to produce the results I posted.

#include <stdio.h>

int main ()
{
  char buf;
  char buf2;

  fread (&buf, 1, 1, stdin);
  fseek (stdin, 0, SEEK_CUR);
  fread (&buf2, 1, 1, stdin);

  printf ("%c %c\n", buf, buf2);
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]