when I declare a protected data item in a class, which means that it is not available to the outside world, but to a derived class. My question is:
will it be available for a class derived from a derived class?
Yes, protected data members are available right up to the inheritance hierarchy.
Protected data is usually best avoided. An alternative is to create secure methods for accessing personal data. This allows you to store data in one class. It also makes it easy to set a breakpoint for data changes.
In fact, a protected data member is only accessible using secure and open inheritance.
Here is an example where a protected member is not available in a derived class:
class Base { protected: int iBase; }; class Derived : private Base { // iBase not accessible };
Yes. (By the way, you would just try this.)
Source: https://habr.com/ru/post/1332159/More articles:Rails3 - How to create a submit button for a nested resource - ruby-on-railsGoogle Chart Color - colorsThe Most Effective Ruby Input Reading Method - ruby ββ| fooobar.comCreating a strict password scheme when all data is stored on the device - javahttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1332158/using-base-class-methods-to-initialize-derived-class-members&usg=ALkJrhj8K_tCqmO7Qui__NswhaaD0zTXqAhow to change reCaptcha style like stackoverflow and facebook - javascriptBest 2D C ++ API? - c ++Visual Studio addin; highlight all words that match the selected word? - visual-studioproblem with named create function in delphi - delphirails - what does it mean - a few values ββfor a block parameter (0 for 1) - mean? - ruby-on-railsAll Articles