C
chandanlinster
Consider the following program fragment:
/************************/
struct some_struct {
}a;
printf("%d", sizeof(a));
/*************************/
On GCC 4.1.1 the output is 0(zero).
On another compiler {sorry I don't know the compiler :-( } the output
is 1(one).
Is it compiler dependent?
If so how can a variable like "a" have a zero size ( I mean how can a
variable with 0(zero) byte size be stored in memory).
/************************/
struct some_struct {
}a;
printf("%d", sizeof(a));
/*************************/
On GCC 4.1.1 the output is 0(zero).
On another compiler {sorry I don't know the compiler :-( } the output
is 1(one).
Is it compiler dependent?
If so how can a variable like "a" have a zero size ( I mean how can a
variable with 0(zero) byte size be stored in memory).