View Single Post
Old Feb 3rd, 2007, 11:36 AM   #3
Eoin
Hobbyist Programmer
 
Eoin's Avatar
 
Join Date: Jun 2006
Location: Ireland
Posts: 152
Rep Power: 3 Eoin is on a distinguished road
Hi v0id, the internal format of a std::string is not specified specifically so you cannot rely on something like say an empty string being 'zero'ed unfortunately. In addition I suspect trying to access index's outside the strings length is very dangerous.

I would advise designing your own simple string class based on your needs, perhaps one which you could convert to and from std::strings as you need. You could use something like std::vector<char> for the memory which would mean you'd know exactly what is going on beneath the surface.

[edit] you beat me to the answer
__________________
Visit my website BinaryNotions.
Eoin is offline   Reply With Quote