GfG QA is closing soon... Please refer PRACTICE or GfG now on wards !!

What is the output and why?

struct A{

int main()
        A obj;
    return 0;


asked Nov 26, 2015 by passion34

1 Answer

Size of an empty class is not zero. It is 1 byte generally. It is nonzero to ensure that the two different objects will have different addresses. 
Check more examples at :

answered Nov 26, 2015 by Swanky

btw it is structure.