CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8
  1. #1
    Join Date
    Mar 2008
    Posts
    30

    why data members should keep private?

    :-)

  2. #2
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,637

    Re: why data members should keep private?

    To protect the integrity of your class and to relieve users of the class of the burden of needing to know the implementation details.

  3. #3
    Join Date
    Mar 2002
    Location
    St. Petersburg, Florida, USA
    Posts
    12,125

    Re: why data members should keep private?

    This question has been answered at length here many times....

    Why dont you just do a search, instead of asking volunteers to do it for you????

    If you read some posts and dont understand the reasons, then by all means ask specific questions.....
    TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
    2008, 2009,2010
    In theory, there is no difference between theory and practice; in practice there is.

    * Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
    * How NOT to post a question here
    * Of course you read this carefully before you posted
    * Need homework help? Read this first

  4. #4
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: why data members should keep private?

    A better question: Why *not*?

  5. #5
    Join Date
    Mar 2008
    Posts
    30

    Re: why data members should keep private?

    I'm searching answers too...
    that's why i posted my question here so that somebody could help in searching while I'm searching too... it is easier right?....there is somebody helping you to do the task....working together.....

    why data member should keep private?

    data member under class under C++.....should make it private........why......
    clear...what dya think?....
    Last edited by richard_tominez; May 22nd, 2008 at 01:19 PM. Reason: to make my reply easier to understand

  6. #6
    Join Date
    Jun 2006
    Location
    M31
    Posts
    885

    Re: why data members should keep private?

    Quote Originally Posted by richard_tominez
    naghahanap din naman ako ng sagot ah...
    kaya nga ako nagpost dito para mapadali yung paghahanap ko ng sagot kasi may tutulong sa akin habang naghahanap ako.....

    yung tanong ko klaro naman nasa C++ non-visual issues
    kapag sinabing data members tumutukoy iyon sa class....

    ano ba problema mo tol?!!!
    Oh snap!

  7. #7
    Join Date
    Oct 2002
    Location
    Timisoara, Romania
    Posts
    14,360

    Re: why data members should keep private?

    Marius Bancila
    Home Page
    My CodeGuru articles

    I do not offer technical support via PM or e-mail. Please use vbBulletin codes.

  8. #8
    Join Date
    Mar 2008
    Posts
    30

    Re: why data members should keep private?

    Thanks for your help!

    Topic Solved

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured