Re: [Dev-C++] Question about Classes: Public vs. Private.
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
From: Per W. <pw...@ia...> - 2007-11-29 15:03:26
|
"The book" and "p. 120". It sounds like you are talking about a specific book, but you are not mentioning which. Now, that makes _me_ a bit confused :) No, the private members may not be accessed by any code lines outside of the class. So, if you rename them, or change the data structures for storing that data, then you know that no code outside of the class will fail or need to be modified. If you make changes to public members, then there may be users that expects the original names/behaviour of these members. /pwm On Thu, 29 Nov 2007 rus...@ao... wrote: > > > > > > I'm a bit confused on the > private vs public aspects of member data. The book states that by > making it private clients won't need to worry about how it's stored or > computed (p. 120). However doesn't that same premise hold true for the public > members as well? > > ?What are the advantages of private member data? > > > > > > > > Thanks, > > > Russ > ________________________________________________________________________ > More new features than ever. Check out the new AOL Mail ! - http://o.aolcdn.com/cdn.webmail.aol.com/mailtour/aol/en-us/text.htm?ncid=aolcmp00050000000003 > |