my two reasons were the parameter list and the "friend"
friend is used for allowing global functions or other objects to reference your private data. I can't imagine it having any effect or being appropriate syntax on your own member function.
second, I don't think operator= can have two parameters.
That's funky
Here's how you do what you are talking about:
Code:
class String
{
public:
String();
String(String&);
String(char*);
virtual ~String();
String& operator =(const String&);
String& operator =(const char*);
operator char *();
private:
char *lpzstr;
};
it may look completely wild but it works. operator char* will return the string and you will be super happy!
String dummystring = "hi there";
char *test = dummystring;