Making the example a bit shorter.

Although changing the requirement from reading filenames from cin,
to taking them from the command line.
Added example of shared_ptr class.