#include <stdio.h>
int main()
{
struct name
{
int x;
struct name *ptr;
};
struct name a;
printf("size is %d",sizeof(a));
return 0;
}
The result of this code is 16 bytes.How compiler has calculated the size of *ptr?
#include <stdio.h>
int main()
{
struct name
{
int x;
struct name *ptr;
};
struct name a;
printf("size is %d",sizeof(a));
return 0;
}
The result of this code is 16 bytes.How compiler has calculated the size of *ptr?