Click here to Skip to main content
15,900,108 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Private member. Pin
Mark Salsbery25-May-07 5:25
Mark Salsbery25-May-07 5:25 
GeneralRe: Private member. Pin
shiraztk25-May-07 5:34
shiraztk25-May-07 5:34 
GeneralRe: Private member. Pin
Mark Salsbery25-May-07 5:42
Mark Salsbery25-May-07 5:42 
AnswerRe: Private member. Pin
CPallini25-May-07 5:33
mveCPallini25-May-07 5:33 
AnswerRe: Private member. Pin
Manoj Kumar Rai25-May-07 5:46
professionalManoj Kumar Rai25-May-07 5:46 
AnswerRe: Private member. Pin
Expert Coming25-May-07 8:31
Expert Coming25-May-07 8:31 
GeneralRe: Private member. Pin
David Crow25-May-07 10:04
David Crow25-May-07 10:04 
AnswerRe: Private member. Pin
John R. Shaw25-May-07 14:51
John R. Shaw25-May-07 14:51 
KISS.

Internally a class must be able to access private members of an object of the same class so that it able to copy it or swap contents with it. That is you would find if very difficult (or impossible) to write copy constructors or “=” assignment operators if objects of the same class where not friends.

The ‘main’ example you supplied is different because the assignment is being made outside of the class objects and from the out side there is no friendship.

By the way, your ‘Get’ is an assignment (or copying) method and does not get anything.


INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra

QuestionMangling of CString in fstream Pin
ldsdbomber25-May-07 4:18
ldsdbomber25-May-07 4:18 
AnswerRe: Mangling of CString in fstream Pin
David Crow25-May-07 4:43
David Crow25-May-07 4:43 
GeneralRe: Mangling of CString in fstream Pin
Stephen Hewitt27-May-07 15:15
Stephen Hewitt27-May-07 15:15 
QuestionRe: Mangling of CString in fstream Pin
David Crow27-May-07 16:49
David Crow27-May-07 16:49 
AnswerRe: Mangling of CString in fstream Pin
Stephen Hewitt27-May-07 16:54
Stephen Hewitt27-May-07 16:54 
GeneralRe: Mangling of CString in fstream Pin
David Crow27-May-07 16:56
David Crow27-May-07 16:56 
AnswerRe: Mangling of CString in fstream Pin
Stephen Hewitt27-May-07 15:13
Stephen Hewitt27-May-07 15:13 
Questionoperator overloading Pin
Kiran Pinjala25-May-07 3:42
Kiran Pinjala25-May-07 3:42 
AnswerRe: operator overloading Pin
David Crow25-May-07 3:45
David Crow25-May-07 3:45 
GeneralRe: operator overloading Pin
Kiran Pinjala25-May-07 3:47
Kiran Pinjala25-May-07 3:47 
GeneralRe: operator overloading Pin
David Crow25-May-07 3:51
David Crow25-May-07 3:51 
GeneralRe: operator overloading Pin
Kiran Pinjala25-May-07 4:19
Kiran Pinjala25-May-07 4:19 
GeneralRe: operator overloading Pin
Mark Salsbery25-May-07 5:30
Mark Salsbery25-May-07 5:30 
QuestionSTL string calling delete and crashing... [modified] Pin
sandeepkavade25-May-07 1:27
sandeepkavade25-May-07 1:27 
AnswerRe: STL string calling delete and crashing... Pin
Cedric Moonen25-May-07 2:02
Cedric Moonen25-May-07 2:02 
GeneralRe: STL string calling delete and crashing... Pin
sandeepkavade25-May-07 2:24
sandeepkavade25-May-07 2:24 
GeneralRe: STL string calling delete and crashing... Pin
Cedric Moonen25-May-07 2:42
Cedric Moonen25-May-07 2: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.