Thread: private variables

  1. #1
    Registered User
    Join Date
    Nov 2010
    Posts
    65

    private variables

    what is the meaning of PRIVATE members
    i think one of their purpose is to protect us from wrongly changing them, am i right?

  2. #2
    3735928559
    Join Date
    Mar 2008
    Location
    RTP
    Posts
    838
    they're members that aren't accessible outside the class. yes, the primary purpose is to prevent someone from mucking up members that are critical to using the object; another is to keep the interface relevant, clean, and uncluttered.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Private variables lose value between functions
    By SkylerZio in forum C++ Programming
    Replies: 6
    Last Post: 05-15-2010, 11:43 PM
  2. private variables, functions help
    By StealthRT in forum C++ Programming
    Replies: 6
    Last Post: 09-10-2009, 08:56 AM
  3. Protected / Private Variables accessable.
    By +Azazel+ in forum C++ Programming
    Replies: 19
    Last Post: 09-08-2009, 07:39 PM
  4. about private class variables
    By bulletbutter in forum C++ Programming
    Replies: 5
    Last Post: 04-18-2008, 12:13 PM
  5. Public vs. Private variables in classes
    By blankstare77 in forum C++ Programming
    Replies: 13
    Last Post: 08-31-2005, 05:43 PM