View Single Post
Old Jul 14th, 2007, 8:04 AM   #6
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
The vector in kkk holds strings allocated on the heap, which are referred by pointers. What you are storing in the file are the pointers. When you delete kkk, you are deleting the information. The pointers become invalid. When you read the file, you put these invalid pointers in lll. When they get dereferenced during the cout, el puko on el shoes.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote