home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Media Share 9
/
MEDIASHARE_09.ISO
/
cprog
/
blx21.zip
/
BC31.ARJ
/
VM.CPP
< prev
next >
Wrap
Text File
|
1992-04-22
|
330b
|
35 lines
struct BASE
{
int x;
virtual int f();
BASE(int c) : x(c) {};
};
int BASE::f()
{
return x;
}
struct TEMP
{
int y;
};
struct DERV:TEMP,BASE
{
DERV(int c) : BASE(c) {};
};
DERV d(1), *p = &d;
int main()
{
int count = 0;
for (long i = 1000000; i; --i)
count += p->f();
return 0;
}