P
pratap
consider this code snippet
#include<iostream>
using namespace std;
class A
{
void func()
{
}
void func1()
{
}
void func2()
{
}
void func3()
{
}
};
int main()
{
cout<<sizeof(A)<<endl;
return 0;
}
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.
Regards
Pratap
#include<iostream>
using namespace std;
class A
{
void func()
{
}
void func1()
{
}
void func2()
{
}
void func3()
{
}
};
int main()
{
cout<<sizeof(A)<<endl;
return 0;
}
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.
Regards
Pratap