Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Esimerkki 2. Moniperiytymisen ongelma.

CHevonen:

Code Block
class CHevonen
{
public:
    void Syo() {
    }
};

CLintu:

Code Block
class CLintu
{
public:
    void Syo() {
    }
};

CPegasus:

Code Block
class CPegasus :
    public CHevonen,
    public CLintu
{
};

main:

Code Block
int main()
{
    CPegasus pegasus;

    pegasus.Syo();
}

...