another problem with ostringstream

dek@cgl.ucsf.edu dek@cgl.ucsf.edu
Thu Aug 5 12:37:00 GMT 1999


OK, the following program fails for me (Mandrake 6.0, gcc-2.95, libstdc++ from CVS).
It only fails if i_max is set high enough, about 250 or so.  I get a string full of
NULLs with just one character.
 
#include <fstream>
#include <iostream>
#include <sstream>

const int i_max=250;

int main()
{

  ostringstream x;

  for (int i=0; i < i_max; i++) {
    x << "Test" << endl;
  }
  std::cout << x.str() << endl;

  return 0;
}




More information about the Libstdc++ mailing list