cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
Quick Question: Does a Derived Class hav
Quick Question: Does a Derived Class have access to private members of the base class?
May 4, 2015 at 6:13pm UTC
newbiee999
(112)
Same thing with inheritance. When you inherit a class, does private/protected members also get derived and/or inherited?
Thanks!
May 4, 2015 at 6:27pm UTC
fg109
(709)
http://www.learncpp.com/cpp-tutorial/115-inheritance-and-access-specifiers/
Basically, derived classes can only access protected and public members of the base class.
Last edited on
May 4, 2015 at 6:30pm UTC
May 4, 2015 at 6:35pm UTC
newbiee999
(112)
@ fg109,
Thanks for the link! It was very helpful :)
Topic archived. No new replies allowed.