B
balasubramaniam
I comile the code in unix where sizof(int)=4
#include<iostream>
using namespace std;
class A
{
int i;
static int j;
};
int A::j = 10;
int main()
{
cout<<sizeof(A)<<endl;
}
both i,j are members of class A.so sizeof(A) should be printed as 8.
But i get 4.
could anyone explain this behavior.
#include<iostream>
using namespace std;
class A
{
int i;
static int j;
};
int A::j = 10;
int main()
{
cout<<sizeof(A)<<endl;
}
both i,j are members of class A.so sizeof(A) should be printed as 8.
But i get 4.
could anyone explain this behavior.