Re: [Flightgear-devel] stl string question

2004-09-13 Thread James Gallagher
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

RE: [Flightgear-devel] stl string question

2004-09-10 Thread Jon Berndt
> 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

Re: [Flightgear-devel] stl string question

2004-09-10 Thread Frederic Bouvier
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