Because cout knows how to print char*. It doesn't know how to print MyStrings, until either (1) you define how to convert MyStrings into char* -- this is what you did, or (2) you define << to work...
Type: Posts; User: tabstop
Because cout knows how to print char*. It doesn't know how to print MyStrings, until either (1) you define how to convert MyStrings into char* -- this is what you did, or (2) you define << to work...
I still don't quite know what your question is, but we'll try this:
operator char*() is the old-style C casting: just like you can cast an integer to float by (float)int_var, you can cast to char*...