Private & protected

This is a discussion on Private & protected within the C++ Programming forums, part of the General Programming Boards category; I need to use inheritance but I also need accessors & mutators Do protected variables act like private variables but ...

  1. #1
    Registered User
    Join Date
    Mar 2010
    Posts
    20

    Private & protected

    I need to use inheritance but I also need accessors & mutators
    Do protected variables act like private variables but with inheritance?

    If I use private and inheritance my subclasses can't find these variables.. though if they are public or private it works..

  2. #2
    Registered User whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    7,761

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Currency Calculator
    By desiamerican in forum C# Programming
    Replies: 1
    Last Post: 01-21-2010, 09:53 PM
  2. Protected / Private Variables accessable.
    By +Azazel+ in forum C++ Programming
    Replies: 19
    Last Post: 09-08-2009, 08:39 PM
  3. C# and SQL
    By siten0308 in forum C# Programming
    Replies: 2
    Last Post: 07-09-2008, 01:34 PM
  4. webBrowser problem
    By algi in forum C# Programming
    Replies: 7
    Last Post: 08-19-2005, 10:35 AM
  5. Need help with calculator program
    By Kate in forum C# Programming
    Replies: 1
    Last Post: 01-16-2004, 10:48 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21