consider this code snippet
why is the compiler forced to allocate 1 byte of memory for a class
which contains no data members.suppose i define more than 1 functions
inside this class ,why is the size of the class still 1 byte. What is
the reason for the allocation of 1 byte by the compiler for the class
A.
#include<iostream>
using namespace std;
class A
{
void func()
{ }
void func1()
{ }
void func2()
{ }
void func3()
{ }
};
int main()
{
cout<<sizeof(A)<<endl;
return 0;
}
Regards
Pratap