Boost logo

Boost Users :

Subject: Re: [Boost-users] tokenizer problem
From: Medora Schauer (mschauer_at_[hidden])
Date: 2009-03-12 15:55:26


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_at_[hidden] [mailto:boost-users-
> bounces_at_[hidden]] On Behalf Of Steven Watanabe
> Sent: Thursday, March 12, 2009 11:56 AM
> To: boost-users_at_[hidden]
> 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_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net