[vtkusers] data format problem
Randy Heiland
heiland at ncsa.uiuc.edu
Fri Feb 7 10:47:50 EST 2003
I tracked down my problem... vtkDataReader::ReadString() is reading a full
256 chars - right past linefeeds - wrongo! There's apparently something funky
with my gcc version 3.2.1. Here's a simple pgm for testing:
// g++ tstream.cxx -o tstream
#include <iostream.h>
#include <fstream.h>
int main()
{
char line[10];
istream *IS;
IS = new ifstream("foo.dat", ios::in);
IS->width(10);
*IS >> line;
printf("%s\n",line);
return 0;
}
where foo.dat:
line1
line2
line3
On my funky Linux/gcc 3.2.1, I get:
% tstream
line1
lin
On my more normal Linux/gcc 2.95.3, I get:
% tstream
line1
Sorry for this off-topic subject, but if anyone has heard of this sort of bug
with gcc, I'd appreciate hearing from you :)
--Randy
More information about the vtkusers
mailing list