+ 1

Why my code is not working? (i know it is nonsense) Help me please

https://code.sololearn.com/cNNSGT82v4Hy/?ref=app

6th Apr 2020, 6:30 PM
Š”ŠµŠ½Šøс Š›Š°ŠæшŠøŠ½
Š”ŠµŠ½Šøс  Š›Š°ŠæшŠøŠ½ - avatar
2 Answers
+ 3
Use number = 10; not Number(10); Your just constructing another Number within your constructor and discarding it immediately. Take a look at the constructor initializer list for a more efficient way to initialize your variables in a constructor: https://en.cppreference.com/w/cpp/language/initializer_list
6th Apr 2020, 7:11 PM
Dennis
Dennis - avatar
0
thanks a lot
6th Apr 2020, 10:49 PM
Š”ŠµŠ½Šøс Š›Š°ŠæшŠøŠ½
Š”ŠµŠ½Šøс  Š›Š°ŠæшŠøŠ½ - avatar