In your first post, at line 20 you haven't defined a << operator for Mystring. I suggest that you define osteam & operator << (ostream &, const Mystring &)
In your second post, what is the point of ArrayOb? All it does is put a wrapper around the template class. I'd get rid of it and use the template directly.
Line 28. ptr is a pointer, so to fix the syntax error, you'd need to assign it to another pointer. But a pointer to what? And what value?
Take a step back. What are you trying to accomplish here? If you're storing a sparse array then you need to store both the index and the value somehow. How are you planning to do that? Figure out how you [i]want the class to work first. Write comments in the class declaration to describe this. Then write code to realize your intention. Doing it this way will break the problem down into a design part, and an implementation part. It's much easier to write the code when you have a clear idea ahead of time about what the code should do.