Linked Questions
38 questions linked to/from What are access specifiers? Should I inherit with private, protected or public?
1291 votes
17 answers
808k views
What is the difference between public, private, and protected inheritance?
What is the difference between public, private, and protected inheritance in C++?
16 votes
1 answer
9k views
c++ inheritance syntax [duplicate]
Possible Duplicate: What are access specifiers? Should I inherit with private, protected or public? Difference between private, public and protected inheritance in C++ To all you cpp experts, In ...
3 votes
5 answers
3k views
How to grant access to a private method [duplicate]
Possible Duplicate: What are access specifiers? Should I inherit with private, protected or public? I am looking for some code or design pattern to grant access to a private method from another ...
-3 votes
4 answers
4k views
Protected types in C++ [duplicate]
Possible Duplicate: What are access specifiers? Should I inherit with private, protected or public? While going through the Qt API documentation, I came across protected types. What are protected ...
1 vote
1 answer
2k views
Base class access specification vs class member access specification [duplicate]
How is base class access specification different from member access specification?
-1 votes
2 answers
257 views
C++ class beginner [duplicate]
How do you guys find the value of s.x from this code I am beginner of c++ and dont know how to solve it Please help thanks // StarterLab.c : C Program to convert to C++ // //#include "stdafx.h" ...
0 votes
5 answers
272 views
C++ Access Control [duplicate]
I want to define within a class a variable that can be read by any other function but that can be modified only by member function. For example, C# has the Property for this purpose. Traditionally, ...
-4 votes
2 answers
251 views
why doesnt the support of "public" or "private" or "protected" Inheritance not give in c# [duplicate]
i know in c++, inheritance is either "public" or "private" or "protected" that meas if i inherit class A publicly to class B as follows class A { public int pub1; private int prvt1; ...
1 vote
2 answers
180 views
How to make C++ inheritance preserve access specifer [duplicate]
Possible Duplicate: What are access specifiers? Should I inherit with private, protected or public? How can I create a derived class in C++ which preserves the properties and methods' access ...
0 votes
1 answer
191 views
How access specifiers ( private/public/protected ) works internally (restricts member access)? [duplicate]
I am trying to understand how exactly c++ class data member access has been restricted/controlled using access specifiers
0 votes
0 answers
98 views
About accessing non-static members of a struct C++ [duplicate]
I am currently writing a Vector2d class in c++ and there is an "Angle" method which is used without an instance of vector2d (static). The problem is, user is able to call other non-static ...
0 votes
0 answers
72 views
can a derived class change the protected members of its indirect base class [duplicate]
Class B inherits publicly class A, and class C inherits publicly class B. 1) My question is can class C make changes to protected data members of class A ? 2) Also I believe that class C can access ...
56 votes
4 answers
44k views
C++ friend inheritance?
Does a subclass inherit, the main class' friend associations (both the main class' own and other classes friended with the main class)? Or to put it differently, how does inheritance apply to the ...
11 votes
6 answers
3k views
Pointer to base class and private inheritance
The following simple example will produce a compiler error, since I accidently use private inheritance: main.cpp:21: error: ‘A’ is an inaccessible base of ‘B’ class A { }; class B : /*ups forgot ...
9 votes
5 answers
4k views
What is difference between protected and private derivation in c++ [duplicate]
Possible Duplicate: Difference between private, public and protected inheritance in C++ What is difference between deriving as protected or private in c++? i am not able to figure out, since both ...