Linked Questions

1291 votes
17 answers
808k views

What is the difference between public, private, and protected inheritance in C++?
user avatar
16 votes
1 answer
9k views

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 ...
gdlamp's user avatar
  • 617
3 votes
5 answers
3k views

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 ...
Patouf's user avatar
  • 129
-3 votes
4 answers
4k views

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 ...
Gandalf's user avatar
  • 13.7k
1 vote
1 answer
2k views

How is base class access specification different from member access specification?
user1824518's user avatar
-1 votes
2 answers
257 views

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" ...
user2557607's user avatar
0 votes
5 answers
272 views

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, ...
user avatar
-4 votes
2 answers
251 views

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; ...
ismail baig's user avatar
1 vote
2 answers
180 views

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 ...
Bình Nguyên's user avatar
0 votes
1 answer
191 views

I am trying to understand how exactly c++ class data member access has been restricted/controlled using access specifiers
Prachi's user avatar
  • 11
0 votes
0 answers
98 views

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 ...
classworm's user avatar
0 votes
0 answers
72 views

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 ...
Leizer's user avatar
  • 51
56 votes
4 answers
44k views

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 ...
SE Does Not Like Dissent's user avatar
11 votes
6 answers
3k views

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 ...
Ronald McBean's user avatar
9 votes
5 answers
4k views

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 ...
paseena's user avatar
  • 4,345

15 30 50 per page