+ 1

C++ basic inheritance question

My input is not 0 but still why 0 is displaying always? https://code.sololearn.com/cHYaqPT2dKWe/?ref=app

25th Oct 2020, 5:03 PM
Gajendra Sonare
Gajendra Sonare - avatar
3 ответов
+ 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.
25th Oct 2020, 5:18 PM
Dennis
Dennis - avatar
0
NotAPythonNinja Thank you so much for your help.
25th Oct 2020, 5:26 PM
Gajendra Sonare
Gajendra Sonare - avatar
0
Dennis Thank you for responding.
25th Oct 2020, 5:26 PM
Gajendra Sonare
Gajendra Sonare - avatar
Актуальное сегодня
.
1 Votes
What?
0 Votes
HTML
0 Votes
Web
0 Votes
Quiz duel
0 Votes
FRC Coding?
1 Votes
help
0 Votes
AI
2 Votes
APIs
1 Votes