home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C++ for Dummies (3rd Edition)
/
C_FD.iso
/
CHAP19
/
CHAP19_1.CPP
next >
Wrap
C/C++ Source or Header
|
1996-09-15
|
421b
|
27 lines
// Chap19_1.cpp
class Account
{
public:
//declare withdrawal pure virtual
virtual void withdrawal(float amnt) = 0;
};
class Savings : public Account
{
public:
virtual void withdrawal(float amnt)
{
}
};
void fn(Account *pAcc)
{
//withdraw some money
pAcc->withdrawal(100.00F); //now it works
};
int main( )
{
Savings s; //open an account
fn(&s);
return 0;
}