You're defining a different answer locally inside your setAnswer member function.
Change line 7 to just answer = x + y;
(This is the same as doing this->answer = x+y;
)
Last edited on
Fair Enough,
Sorry I am too new for this things..
Thanks brother, You taught me a great thing... <3