Listing 3 Exposes the string class's shallow copy

// tstr.cpp
#include <iostream.h>
#include "str.h"

main()
{
   string s("hello"), t = s;

   t[0] = 'j';
   cout << "s == "<< s << endl;
   cout << "t ==" << t << endl;
   return 0;
}

/* Output:
s == jello
t == jello
*/
// End of File