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]
Other format: [Raw text]

STL memory management


hi:

here is my example:
int main()
{
     vector<int>  myvec;
     int  a[3];

    a[4] = 90;
    myvec.push_back(30);
}

As you can see ,access to the array a is over rang, is maybe destroy
myvec's data ,
My question is  : will  the next push_back(30) corrupt memory due to this error

If yes ,what is the internel reason ?


Thanks!


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