STL vector resize/push_back crash

Bob Lapique lapique@ifrance.com
Tue Jul 30 08:03:00 GMT 2002


Hi,

I declared a class called PgColumn and a vector <PgColumn>.

This class has a default constructor, a copy constructor, an overloaded
= operator, a destructor, an overloaded operators == and !=.

The class also has as a property : vector <string> data;

It does not allocate memory nor create new objects.



The problem :
=============
The program crashes randomly when I perform a resize or push_back on
vector :
vector <PgColumn> columns.

e.g. the following code...
   columns.resize(4);
   cout<<colums.size()<<endl;
would display 4205488815 instead of 4 !!!! Why ???
Then,
   columns[0]=tmpCol;
crashes.



It's been giving headaches for 2 long days. Thanks for any help.


 
______________________________________________________________________________
ifrance.com, l'email gratuit le plus complet de l'Internet !
vos emails depuis un navigateur, en POP3, sur Minitel, sur le WAP...
http://www.ifrance.com/_reloc/email.emailif




More information about the Gcc-help mailing list