Re: CString Array to LPCTSTR *
- From: "Vipin" <Vipin@xxxxxxxxxx>
- Date: Wed, 20 Sep 2006 10:24:56 +0530
Doug,
Refer Stroustrup's book where he shows one type of implementation
of string where he has a diagram with segment descriptors and each of the
entries in the descriptor table points to segments of string.
--
Vipin Aravind
http://www.explorewindows.com/Blogs
"Doug Harrison [MVP]" <dsh@xxxxxxxx> wrote in message
news:g5e1h2t52dvsdgtjpcsdnv3tahk1p8paqm@xxxxxxxxxx
On Tue, 19 Sep 2006 23:34:43 -0400, David Wilkinson
<no-reply@xxxxxxxxxxxx>
wrote:
I believe that std::vector is guaranteed to be stored in contiguous
memory, which std::string is not.
Correct for vector, and for practical purposes, std::string is contiguous
as well. At least I've never heard of a non-contiguous std::string, and I
think someone would have to be insane to write one. If you care about the
lack of a guarantee, then you should also remember that std::string may or
may not be reference-counted, data() and c_str() may or may not throw, and
there are probably a couple of other implementation choices I'm
forgetting.
That said, every std::string I've seen has been contiguous, and data() and
c_str() cannot throw. The trend has been to abandon the hopeless form of
reference-counting permitted by the standard, and VC gave it up in version
2002. So I'd say there's a sort of de facto sane implementation that
implementers have adopted.
--
Doug Harrison
Visual C++ MVP
.
- Follow-Ups:
- Re: CString Array to LPCTSTR *
- From: bjarne
- Re: CString Array to LPCTSTR *
- From: David Wilkinson
- Re: CString Array to LPCTSTR *
- From: Doug Harrison [MVP]
- Re: CString Array to LPCTSTR *
- References:
- Re: CString Array to LPCTSTR *
- From: Ajay Kalra
- Re: CString Array to LPCTSTR *
- From: Vipin
- Re: CString Array to LPCTSTR *
- From: Ajay Kalra
- Re: CString Array to LPCTSTR *
- From: Vipin
- Re: CString Array to LPCTSTR *
- From: David Wilkinson
- Re: CString Array to LPCTSTR *
- From: Vipin
- Re: CString Array to LPCTSTR *
- From: David Wilkinson
- Re: CString Array to LPCTSTR *
- From: Doug Harrison [MVP]
- Re: CString Array to LPCTSTR *
- Prev by Date: Re: CString Array to LPCTSTR *
- Next by Date: Re: Regular DLLs Dynamically Linked to MFC theApp
- Previous by thread: Re: CString Array to LPCTSTR *
- Next by thread: Re: CString Array to LPCTSTR *
- Index(es):
Relevant Pages
|