Showing posts with label Memory for Empty Class and Srtucture. Show all posts
Showing posts with label Memory for Empty Class and Srtucture. Show all posts

Tuesday, March 15, 2011

Memory for Empty Class and Srtucture

# include "stdio.h"


class classname
{

void fn1()
{
}
void fn11()
{
}

void fn111()
{
}


};

struct structname
{
};

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


OUTPUT:


1
1
Press any key to continue . . .