David Luff wrote:
> I've always thought that using stl strings was generally safer than
char*,
> but could anyone comment on the below?
>
> string s = "";
> s[2] = 'x';
>
> Am I stomping on random memory with the out-of-range character
> write, or is
> this protected against because it's an stl st
> I've always thought that using stl strings was generally safer than char*,
> but could anyone comment on the below?
>
> string s = "";
> s[2] = 'x';
http://www.roguewave.com/support/docs/ (see the "string" docs)
You might need to do a resize() first.
Jon
David Luff wrote:
> I've always thought that using stl strings was generally safer than char*,
> but could anyone comment on the below?
>
> string s = "";
> s[2] = 'x';
>
> Am I stomping on random memory with the out-of-range character write, or
is
> this protected against because it's an stl stri