This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
STL vector resize/push_back crash
- From: "Bob Lapique" <lapique at ifrance dot com>
- To: <gcc-help at gcc dot gnu dot org>
- Date: Tue, 30 Jul 2002 15:03:04 GMT
- Subject: STL vector resize/push_back crash
- Send-by: 132.166.73.52 with Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.2.1) Gecko/20010901
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