Tools.h++ Manual

104011 Tandem Computers Incorporated 5-1
Strings 5
Manipulating strings is one of the most common and error prone tasks that a
programmer does. It's a perfect opportunity for C++ to show its advantages.
Class
RWCString
has many powerful string processing features that are just as
efficient as C, but far less prone to errors. For example, the class automatically
takes care of memory management. It's just about impossible to delete
something twice or not delete it at all.
Class RWWString offers support for wide character strings. These are strings of
type
wchar_t
which, in general, may consist of more than one byte. The
interface of
RWWString
is extremely similar to
RWCString
, allowing them to
be interchanged easily.
5.1 Example
Here is a short example that exercises the
RWCString
class:
Code Example 5-1
#include <rw/cstring.h>
#include <rw/regexp.h>
#include <rw/rstream.h>
main()
{