This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
STL memory management
- From: Hatt Tom <net dot study dot sea at gmail dot com>
- To: "libstdc++" <libstdc++ at gcc dot gnu dot org>
- Date: Sun, 18 Aug 2013 09:04:21 +0800
- Subject: 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!