Constructor: Member variables not visible / out of scope

This works

Most importantly, the constructor must return the instance created by new.

Your last example results in infinite recursion, because the constructor keeps calling itself.

2 Likes