Hi. I wanted to test if I have successfully
understood simple classes so I wrote this and
now I think I haven't succeed in learning classes!
Here's my main.cpp:
This program builds and runs but the translatedWord()
which was supposed to return "sib" or "Not found!", returns null string.
Couold you please tell me where the problem is.
thanks in advance.
Line 12: You are calling constructor of DictWiord, which calls setWord member function. It sets inputWord equal to enteredWord.
Line 13: YOu are calling translatedWord member function, which returns tranWord. However that variable was never set, so it returns an empty string.
Make setWord function call setTranslate to achieve something.