What storage does std::string::c_str() use?
From: Vyacheslav Kononenko (vyacheslav_at_kononenko.net)
Date: 09/08/04
- Next message: Mel Smith: "Borland's 'Make' Utility Question [ OT ??]"
- Previous message: JKop: "Re: The best, (right?), way to trim a char*"
- Next in thread: Victor Bazarov: "Re: What storage does std::string::c_str() use?"
- Reply: Victor Bazarov: "Re: What storage does std::string::c_str() use?"
- Reply: Old Wolf: "Re: What storage does std::string::c_str() use?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 8 Sep 2004 12:39:58 -0700
All,
If I am not mistaken I had some problems with code like this:
std::string foo, bar;
...
somefunc( foo.c_str(), bar.c_str() );
Problem was that c_str() used buffer shared btw instances of
std::string in that implementation. I did not find anything that
standart would explicitly say about this case. So what would you say?
Thanks,
Slava
- Next message: Mel Smith: "Borland's 'Make' Utility Question [ OT ??]"
- Previous message: JKop: "Re: The best, (right?), way to trim a char*"
- Next in thread: Victor Bazarov: "Re: What storage does std::string::c_str() use?"
- Reply: Victor Bazarov: "Re: What storage does std::string::c_str() use?"
- Reply: Old Wolf: "Re: What storage does std::string::c_str() use?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|