For the first one, you need to create a conversion operator. It looks like:
class Class { public: operator char *() { return str; } char * str;};
That being said, providing conversion operator are generally a bad idea. Implicit conversions can bite you in the rear. Prefer to write a member function that returns a pointer instead.
For the second one, you need a non-member overload of operator<< since the object on the left hand side is a std::ostream. It looks like:
std::ostream & operator<<(std::ostream & lhs, Class & rhs) { lhs << /* whatever */}
You may need to friend the function to get the insides to compile.