# C++: OOP: Classes: Example: xstring

### Programming Problem - xstring

Develop a string-like struct, `xstring`, which we will later turn into a class. The struct should be modeled on the Stash struct in the textbook (see p 230...). It will be used to store character strings, not arbitrary data.

This program will be the basis for future problems, as we extend xstring to become more and more like the STL string class. As we cover topis in the text, we will be using this knowledge to enhance the xstring struct/class.

Because we are aiming at string-like functionality, some Stash functions should have their names changed so that they match those in the STL string class.

### Name changes from Stash to xstring

`void append(const char* cstring);`
  This adds the characters in the cstring to the end of the existing characters. This replaces the add function of Stash.
`int size();`
  This returns the number of characters that are stored in the current xstring. This replaces the count function of Stash.
`char at(int index);`
  This returns the character at position index. It is a replacement for the Stash Fetch function.
Other functions
  Functions such as initialize, cleanup, and inflate may remain with the same names, altho they will change in the future to adapt to the evolution toward string.

### Due

Due: Sunday, Dec 5. The deliverables include `xstring.h`, `xstring.cpp`, `xstringtest.cpp` (a test program).