3 ms·
C++ class scopes have the with problem. class foo { // int x; int y; int bar(); }; // in another file int x; foo::bar() // "w
by kazinator 6y ago
C++ class scopes have the with problem.
class foo {
// int x;
int y;
int bar();
};
// in another file
int x;
foo::bar() // "with whole friggin class scope ..."
{
return x + y; // global ::x plus class member y
}
Now uncomment the x in the class declaration, and the x + y now adds two class members.