+ 1

Please explain inner working of code

Actually in this program I call distructor on time but A is print two time. so please explain anyone. https://code.sololearn.com/ci8y9OprjI2i/?ref=app

19th Apr 2017, 5:48 PM
Rajesh Kumar (Rj)
Rajesh Kumar (Rj) - avatar
1 Answer
+ 12
You called the destructor once, and it's called another time when it is destroyed before main returns.
19th Apr 2017, 5:53 PM
Karl T.
Karl T. - avatar