Re: CString help
- From: "Doug Harrison [MVP]" <dsh@xxxxxxxx>
- Date: Sun, 24 Jun 2007 17:10:05 -0500
On Sun, 24 Jun 2007 14:33:54 -0700, "Mihai N." <nmihai_year_2000@xxxxxxxxx>
wrote:
But reading it, I still think there is no decend standard way to write
something in a standard string in a standard way.
Even if the storage is contigous, the data is still const, you I cannot
safely change it.
The following will be fine:
string s;
s.resize(n);
memcpy(&s[0], 0, n);
One of the benefits to requiring s[0] to return a real reference (which is
what disallows COW) is that &s[0] returns a real pointer.
--
Doug Harrison
Visual C++ MVP
.
- Follow-Ups:
- Re: CString help
- From: Mihai N.
- Re: CString help
- From: Doug Harrison [MVP]
- Re: CString help
- References:
- CString help
- From: jp2code
- Re: CString help
- From: Ajay Kalra
- Re: CString help
- From: jp2code
- Re: CString help
- From: David Wilkinson
- Re: CString help
- From: Mihai N.
- Re: CString help
- From: Doug Harrison [MVP]
- Re: CString help
- From: Mihai N.
- Re: CString help
- From: Doug Harrison [MVP]
- Re: CString help
- From: Mihai N.
- Re: CString help
- From: Doug Harrison [MVP]
- Re: CString help
- From: Mihai N.
- CString help
- Prev by Date: Re: CString help
- Next by Date: Re: old skool vc++ 1.0
- Previous by thread: Re: CString help
- Next by thread: Re: CString help
- Index(es):
Loading