Node: Strings, Next: , Previous: Hash Tables, Up: Top


Lpp Strings are considerably more efficient than ordinary C++ strings in algorithms that require the length of the string since the length is held as a slot in the String object. Ordinary C++ strings must be searched for the 0 end character. Also, null characters (0 character code) are allowed inside Lpp Strings and not inside ordinary C++ strings. When converting from Lpp Strings to C++ strings the programmer must be aware of this. If there is a 0 in an Lpp String then the converted ordinary C++ string will look like it's been truncated. Rarely is this a problem since either the programmer knows that in an application 0's may be stored in Strings in which case he only uses Lpp Strings (in such a case something like Lpp Strings must be used anyway) or the programmer's application only needs to convert ordinary C++ strings to Lpp Strings but not vice verse.