help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: hash_set core dump on memory free


From: BobR
Subject: Re: hash_set core dump on memory free
Date: 5 Nov 2006 17:00:45 -0500

{ Note: this article is cross-posted to comp.lang.c++, 
microsoft.public.vc.stl, gnu.g++.help and comp.lang.c++.moderated. -mod }

Sébastien Guérif wrote in message
<454d9e0d$0$5074$ba4acef3@news.orange.fr>...
>Rakesh wrote:
>> Hi -
>>   What is wrong this implementation? I get a core dump at the free()
>> statement? Thanks
>> Rakesh
>
>Hi Rakesh!
>
>> for (Iter1 = AddedPhrases.begin(); Iter1 != AddedPhrases.end();
>> Iter1++)
>
>Just replace Iter1++ by ++Iter1 above.

{
for( size_t i(0); i < 5; i++ ){
      std::cout<<" i = "<< i << std::endl;
      }
std::cout<<std::endl;
for( size_t i(0); i < 5; ++i ){
      std::cout<<" i = "<< i << std::endl;
      }
}

// i = 0
// i = 1
// i = 2
// i = 3
// i = 4

// i = 0
// i = 1
// i = 2
// i = 3
// i = 4

--
Bob R
POVrookie


-- 
      [ See http://www.gotw.ca/resources/clcm.htm for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]



reply via email to

[Prev in Thread] Current Thread [Next in Thread]