What is the expected behavior of the following code?
What is the expected behavior of the following code?
A
Using correct mangling, o._Class__foo(), gives an output of 2. So answer is A.
because of the typos: A. it raises an exception
which typos?
if we magle correctly, we would get the output 2, which is not in the answer list. The first call to o._Class__foo() increments Var by 1 and returns the updated value, which is 1. The second call to o._Class__foo() again increments Var by 1 (now it's 2) and returns the updated value, which is 2.
Mangling error