chapter 12 exercise 12-0 and 12-1: Implement Str class, which manages the storage itself