Click here to Skip to main content
15,906,341 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
GeneralRe: Any example of why do we use private in Classes? Pin
Michael Dunn22-May-03 18:46
sitebuilderMichael Dunn22-May-03 18:46 
QuestionHow to write automated device driver installation in MFC? Pin
Member 40481322-May-03 16:44
Member 40481322-May-03 16:44 
GeneralDefine BIT level Struct Pin
Paul Farry22-May-03 16:36
professionalPaul Farry22-May-03 16:36 
GeneralRe: Define BIT level Struct Pin
Serge Krynine22-May-03 18:14
Serge Krynine22-May-03 18:14 
GeneralRe: Define BIT level Struct Pin
Michael Dunn22-May-03 18:48
sitebuilderMichael Dunn22-May-03 18:48 
GeneralRe: Define BIT level Struct Pin
Serge Krynine22-May-03 19:22
Serge Krynine22-May-03 19:22 
GeneralRe: Define BIT level Struct Pin
basementman23-May-03 4:14
basementman23-May-03 4:14 
QuestionNTFS file tagging? Pin
rcsj122-May-03 15:38
rcsj122-May-03 15:38 
AnswerRe: NTFS file tagging? Pin
Michael Dunn22-May-03 18:52
sitebuilderMichael Dunn22-May-03 18:52 
GeneralSplit String Question.... Pin
Nitron22-May-03 13:49
Nitron22-May-03 13:49 
GeneralRe: Split String Question.... Pin
Joaquín M López Muñoz22-May-03 20:05
Joaquín M López Muñoz22-May-03 20:05 
GeneralRe: Split String Question.... Pin
Nitron23-May-03 2:16
Nitron23-May-03 2:16 
Question"const int" or "int const" ? Pin
Gavin Greig22-May-03 12:57
Gavin Greig22-May-03 12:57 
AnswerRe: "const int" or "int const" ? Pin
Michael Dunn22-May-03 18:57
sitebuilderMichael Dunn22-May-03 18:57 
GeneralRe: "const int" or "int const" ? Pin
Gavin Greig22-May-03 22:58
Gavin Greig22-May-03 22:58 

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.