Click here to Skip to main content
15,923,218 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: don't catch in release? Pin
Toni7822-May-03 22:26
Toni7822-May-03 22:26 
GeneralRe: don't catch in release? Pin
jhwurmbach22-May-03 23:10
jhwurmbach22-May-03 23:10 
GeneralRe: don't catch in release? Pin
Toni7823-May-03 19:20
Toni7823-May-03 19:20 
GeneralRe: don't catch in release? Pin
novachen24-May-03 1:50
novachen24-May-03 1:50 
GeneralRe: don't catch in release? Pin
Toni7824-May-03 18:57
Toni7824-May-03 18:57 
AnswerRe: don't catch in release? Pin
jhwurmbach22-May-03 23:08
jhwurmbach22-May-03 23:08 
GeneralRe: don't catch in release? Pin
novachen24-May-03 1:54
novachen24-May-03 1:54 
AnswerRe: don't catch in release? Pin
Tim Smith23-May-03 1:53
Tim Smith23-May-03 1:53 
GeneralRe: don't catch in release? Pin
saierdia23-May-03 2:33
saierdia23-May-03 2:33 
GeneralPrinting Pin
Petr_P22-May-03 20:29
Petr_P22-May-03 20:29 
GeneralRe: Printing Pin
Anonymous6-Feb-04 0:07
Anonymous6-Feb-04 0:07 
GeneralCStringArray in C++ Pin
Mazdak22-May-03 19:25
Mazdak22-May-03 19:25 
GeneralRe: CStringArray in C++ Pin
Joaquín M López Muñoz22-May-03 19:39
Joaquín M López Muñoz22-May-03 19:39 
GeneralRe: CStringArray in C++ Pin
Mazdak22-May-03 21:24
Mazdak22-May-03 21:24 
QuestionHow to Install a Windows XP theme in MFC program Pin
jia_wei22-May-03 18:37
jia_wei22-May-03 18:37 
QuestionHow do I set the “Comment” attribute of a file or folder using VB script ? Pin
Serge Krynine22-May-03 18:01
Serge Krynine22-May-03 18:01 
QuestionWhat does macro guard do in header file. Pin
Link260022-May-03 17:33
Link260022-May-03 17:33 
AnswerRe: What does macro guard do in header file. Pin
Andrew Walker22-May-03 18:05
Andrew Walker22-May-03 18:05 
GeneralRe: What does macro guard do in header file. Pin
Serge Krynine22-May-03 18:28
Serge Krynine22-May-03 18:28 
AnswerRe: What does macro guard do in header file. Pin
Michael Dunn22-May-03 18:42
sitebuilderMichael Dunn22-May-03 18:42 
GeneralRe: What does macro guard do in header file. Pin
Serge Krynine22-May-03 19:41
Serge Krynine22-May-03 19:41 
QuestionAny example of why do we use private in Classes? Pin
Link260022-May-03 16:49
Link260022-May-03 16:49 
AnswerRe: Any example of why do we use private in Classes? Pin
Andrew Walker22-May-03 18:14
Andrew Walker22-May-03 18:14 
VW_Red_Jetta wrote:
why do we still have Structs in C++?

The reason is to maximise the compatibility with C. C has structs, and the default access level is public, so C++ retains the same system.

VW_Red_Jetta wrote:
But I don't understand why do we use private.

C++ additionally allows classes, and specifies that good encapsulation / good OOP the default access should be private. This ensures that anyone who needs to get/set the properties of a private variable will have to use an accessor or a mutator method. In general, you need to modify the properties of an object via getXXX() and setXXX() methods.

As a rule of thumb, use structs for POD, Plain Old Data (anything without pointers, that doesn't need initialisation or special procudures for copying). Use classes when you need to have your class DO something, rather than just store information.
GeneralRe: Any example of why do we use private in Classes? Pin
Link260022-May-03 18:23
Link260022-May-03 18:23 
GeneralRe: Any example of why do we use private in Classes? Pin
Andrew Walker22-May-03 18:42
Andrew Walker22-May-03 18:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.