home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
listings
/
v_09_07
/
9n07058b
< prev
next >
Wrap
Text File
|
1991-05-02
|
767b
|
36 lines
class Frog {
public:
Frog( char *Name)
{
name = Name;
count++;
}
~Frog() { count--; }
// instance interface
void jump() { distance += 100; }
void hop() { distance += 50; }
void skip() { distance += 25; }
void swim() { distance += 25; }
void print()
{
printf( "Frog name is %s,
distance from pond is %d\n" );
}
// type-as-object interface
// new ...
// sizeof
static int howmany() { return count; }
private:
// instance variables
int distance;
char *name;
// type-as-object variables
static int count;
};