I
Immortal Nephi
I write three classes. The name of class are A, B, and C. Class A
and Class B are inaccessible to the client. Class C is accessible to
the client.
Class B has inheritance to Class A. The member function in class B
modify data in Class A. I need to find a way how Class A can have
inheritance to Class B, but C++ Compiler does not allow it. The rule
of inheritance goes from top to the bottom.
Class A needs to have inheritance to Class B. The member function in
class A modify data in Class B.
It is the way how Class A and Class B can become one class to modify
both Class A's and Class B's data together. Class A is getting too
large over 200,000 lines. It makes easier to divide one class into
two classes for better readable C++ writing.
Class C is derived from both Class A and Class B. Here is an example
how three classes look like.
A-->B A<--B
A-------------B
\ /
\ A and B /
\ Go /
\ Down /
\ To /
\ C /
\ /
|
C
class A;
class B;
class C;
class A : // C++ Compiler disallows....
public B // class A modifies class B's data
{...};
class B : // C++ Compiler allows....
public A // class B modifies class A's data
{...};
class C :
public A, public B // class C displays both classes' data
{...};
Can you please write an example of short source code? Find a way how.
Immortal Nephi
and Class B are inaccessible to the client. Class C is accessible to
the client.
Class B has inheritance to Class A. The member function in class B
modify data in Class A. I need to find a way how Class A can have
inheritance to Class B, but C++ Compiler does not allow it. The rule
of inheritance goes from top to the bottom.
Class A needs to have inheritance to Class B. The member function in
class A modify data in Class B.
It is the way how Class A and Class B can become one class to modify
both Class A's and Class B's data together. Class A is getting too
large over 200,000 lines. It makes easier to divide one class into
two classes for better readable C++ writing.
Class C is derived from both Class A and Class B. Here is an example
how three classes look like.
A-->B A<--B
A-------------B
\ /
\ A and B /
\ Go /
\ Down /
\ To /
\ C /
\ /
|
C
class A;
class B;
class C;
class A : // C++ Compiler disallows....
public B // class A modifies class B's data
{...};
class B : // C++ Compiler allows....
public A // class B modifies class A's data
{...};
class C :
public A, public B // class C displays both classes' data
{...};
Can you please write an example of short source code? Find a way how.
Immortal Nephi