Ah! I wasn't even considering where the string was getting created. It's on the call stack I guess? Thanks!
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users- bounces@lists.boost.org] On Behalf Of Steven Watanabe Sent: Thursday, March 12, 2009 11:56 AM To: boost-users@lists.boost.org Subject: Re: [Boost-users] tokenizer problem
AMDG
Medora Schauer wrote:
I'm having a problem passing strings into a boost tokenizer. I have been able to get the code to work but I don't think I should have had to do what I did. I don't know if it is tokenizer problem or a compiler problem or my problem.
// This version results in garbage in some tokens. char **str = in_strs; while (*str){ str_tokenizer file1_tokens(string(*str), sep); // <-- difference
tokenizer stores the string by reference. The temporary string is destroyed. Boom.
In Christ, Steven Watanabe
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users