In C++, why does the following compile:
struct test { void foo() { this->bar++; } int bar; };
But not the following:
In case of a structure, scope of the member variable is available within the structure. So if you define a function within a structure that variable will be available within the function.
But that is the not the case in second scenario.