+ 1
C++ basic inheritance question
My input is not 0 but still why 0 is displaying always? https://code.sololearn.com/cHYaqPT2dKWe/?ref=app
3 odpowiedzi
+ 2
Because objA and objB are 2 different objects.
You store the input in objA but objB is unaffected by it because it has it's own storage.
Try calling inp on objB instead.
0
NotAPythonNinja Thank you so much for your help.
0
Dennis Thank you for responding.