Click here to Skip to main content
15,912,837 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: removing duplicates via the <b>stl</b> Pin
ZoogieZork3-Sep-03 12:42
ZoogieZork3-Sep-03 12:42 
GeneralRe: removing duplicates via the <b>stl</b> Pin
RChin3-Sep-03 22:33
RChin3-Sep-03 22:33 
Generalwriting an ostream& operator<<( - function Pin
petter_e3-Sep-03 1:24
petter_e3-Sep-03 1:24 
General.pdf to .txt conversion Pin
Chintan3-Sep-03 0:35
Chintan3-Sep-03 0:35 
GeneralRe: .pdf to .txt conversion Pin
David Crow3-Sep-03 2:47
David Crow3-Sep-03 2:47 
GeneralC++ related issue Pin
Jamal Jamshed3-Sep-03 0:29
sussJamal Jamshed3-Sep-03 0:29 
GeneralRe: C++ related issue Pin
dog_spawn3-Sep-03 1:56
dog_spawn3-Sep-03 1:56 
GeneralRe: C++ related issue Pin
Jamal Jamshed3-Sep-03 2:23
sussJamal Jamshed3-Sep-03 2:23 
Consider the following code:

class Parent
{
  public:
    SetValue(int a)
   {
       m_value = a;
   }
  
  private:

    int m_value
};


class Brother:public Parent
{
  brother()
 { 
   SetValue(12)
 {
};

class Sister:public Parent
{
 Sister()
 { 
   SetValue(8)
 }
};


As can be seen above, the two classes "Brother" and "Sister" are derived from the same base class "Parent" Both the children classes have their own copy of "Parent". If the class "Brother" makes any change in the data member of "Parent", then the change will not effect the "Parent" of "Sister" as "Sister" has its own "Parent"

What i want is that, both the children classes should share the "same" parent. And if "Brother" changes the data present in its "Parent", then the data of the "Parent" of "Sister" should also gets changed automatically as both "Brother" and "Sister" will have same subobject "Parent".

How can i achieve this goal.
GeneralRe: C++ related issue Pin
David Crow3-Sep-03 2:49
David Crow3-Sep-03 2:49 
GeneralRe: C++ related issue Pin
Scott H. Settlemier3-Sep-03 10:22
Scott H. Settlemier3-Sep-03 10:22 
GeneralRe: C++ related issue Pin
John R. Shaw3-Sep-03 6:47
John R. Shaw3-Sep-03 6:47 
General_crtBreakAlloc Pin
Bernhard2-Sep-03 23:22
Bernhard2-Sep-03 23:22 
Questioninsert for each Combo Box index a variable edit control? Pin
Member 3971372-Sep-03 22:12
Member 3971372-Sep-03 22:12 
Generalthe problem of SEH Pin
crazyzhou2-Sep-03 21:18
crazyzhou2-Sep-03 21:18 
GeneralRe: the problem of SEH Pin
Brad Sokol3-Sep-03 3:04
Brad Sokol3-Sep-03 3:04 
GeneralRe: the problem of SEH Pin
crazyzhou3-Sep-03 19:14
crazyzhou3-Sep-03 19:14 
GeneralRe: the problem of SEH Pin
Brad Sokol4-Sep-03 2:47
Brad Sokol4-Sep-03 2:47 
Generalwhen i install ms SDK.... Pin
Anonymous2-Sep-03 21:02
Anonymous2-Sep-03 21:02 
GeneralRe: when i install ms SDK.... Pin
John R. Shaw3-Sep-03 6:21
John R. Shaw3-Sep-03 6:21 
GeneralGet the size of RTF text on a print DC Pin
CodeBrain2-Sep-03 20:41
CodeBrain2-Sep-03 20:41 
GeneralRe: Get the size of RTF text on a print DC Pin
eco2-Sep-03 21:09
eco2-Sep-03 21:09 
GeneralRe: Get the size of RTF text on a print DC Pin
eco2-Sep-03 21:12
eco2-Sep-03 21:12 
GeneralRe: Get the size of RTF text on a print DC Pin
CodeBrain3-Sep-03 3:21
CodeBrain3-Sep-03 3:21 
QuestionUnicode issue? How to resolve? Pin
Yu Zhiquan2-Sep-03 20:15
Yu Zhiquan2-Sep-03 20:15 
GeneralMFC Gurus Only1 Pin
John R. Shaw2-Sep-03 19:24
John R. Shaw2-Sep-03 19:24 

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.