c++ - Use the private variable of the superclass with friend -


i have class private variable a. class b subclass of a. in class b_test, wrtite "b b; b.a;", put friend class c in both class , class b still no works.

any idea? thank you.

(sorry make mistake in code when post question. solved now). rod_algonquin right. thank you.)

private members not inherited. if want access member in inherited class, need use protected modifier.


Comments

Popular posts from this blog

php - render data via PDO::FETCH_FUNC vs loop -

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

The canvas has been tainted by cross-origin data in chrome only -