home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C++ for Dummies (3rd Edition)
/
C_FD.iso
/
CHAP27
/
CHAP27_2.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1996-09-15
|
715b
|
59 lines
// Chap27_2.cpp
#include <iostream.h>
//Furniture - more fundamental concept; this class
// has "weight" as a property
class Furniture
{
public:
Furniture()
{
}
int weight;
};
class Bed : public Furniture
{
public:
Bed()
{
}
sleep()
{
}
};
class Sofa : public Furniture
{
public:
Sofa()
{
}
void watchTV()
{
}
};
class SleeperSofa : public Bed, public Sofa
{
public:
SleeperSofa()
{
}
void foldOut()
{
}
};
void fn()
{
SleeperSofa ss;
cout << "weight = "
<< ss.weight //problem solved; right?
<< "\n";
}
int main()
{
fn();
return 0;
}