Feb 1, 2019 at 9:21am
--
Last edited on Feb 1, 2019 at 10:59pm
Feb 1, 2019 at 9:45am
bool operator == (const char rightside)
You wrote an operator here that accepts a single const char.
w1 == "Apple"
"Apple"
is not a single const char. For the purposes of this code, it's effectively a const char*
A const char
is not the same as a const char*
Last edited on Feb 1, 2019 at 9:46am
Feb 1, 2019 at 7:49pm
--
Last edited on Feb 1, 2019 at 10:59pm
Feb 1, 2019 at 9:41pm
--
Last edited on Feb 1, 2019 at 10:59pm
Feb 1, 2019 at 10:16pm
Why did you comment out line 13?
Feb 1, 2019 at 10:27pm
--
Last edited on Feb 1, 2019 at 10:59pm
Feb 1, 2019 at 10:38pm
Well, line 13 would enable to compare the class with a string so that
if (w1 == "Apple")
works.