Tuesday, March 15, 2011

Virtual method memory

# include "stdio.h"


class classname
{

void virtual fn1()
{
}



};

class classname2
{

void virtual fn1()
{
}

void virtual fn11()
{
}


};

int main()
{
printf("%d\n%d\n",sizeof(classname),sizeof(classname2));
return 0;
}

OUTPUT:

4
4
Press any key to continue . . .

No comments:

Post a Comment