Class constructor with initialization
I want to be able to declare a class instance and give it an initial value like this.
MORSE instanceName = 'A';
I know I could do it with just passing 'A' as a parmeter but I'd like to make it look more like the standard data types.
I'm thinking that
does it's stuff with the default constructor and then the equal sign evaluates, if I'm guessing right then all I need is to overload the = operator so it can take a char as the right operand and a MORSE as the left operand.
What's the syntax for the implementation of the equal sign if I needed to assign the right operand to a private variable called letter
Should it be a member function or friend function?
Does the equal sign return a value?
Thanks in advance for replies.