P
__PPS__
Hello everybody, today I had another quiz question
"if class X is privately derived from base class Y what is the scope of
the public, protected, private members of Y will be in class X"
By scope they meant public/protected/private access modifiers
Obviously all members of the base privately inherited class will be
private, and that was my answer. However, the teacher checked my
answers when I handed in, and the problem was that I had to specify
that private members of base class are not inherited (that the way he
called that they were inaccessible from inside of the derived class),
however, it doesn't make my answer incorrect - all of them are still
private. The question from the beginning didn't mean anything that I
had to specify if the private members were accessible or not, I only
had to specify their "scope".
Was my answer correct or not?
thanks
"if class X is privately derived from base class Y what is the scope of
the public, protected, private members of Y will be in class X"
By scope they meant public/protected/private access modifiers
Obviously all members of the base privately inherited class will be
private, and that was my answer. However, the teacher checked my
answers when I handed in, and the problem was that I had to specify
that private members of base class are not inherited (that the way he
called that they were inaccessible from inside of the derived class),
however, it doesn't make my answer incorrect - all of them are still
private. The question from the beginning didn't mean anything that I
had to specify if the private members were accessible or not, I only
had to specify their "scope".
Was my answer correct or not?
thanks