The sizeof
operator is a compile time operator but in the program below it is changing at run time.
#include <stdio.h>
void func (int i) {
int a[i];
printf("%d \n", sizeof(a));
}
main() {
int i = 0;
while(i <= 5) {
func(i);
i++;
}
}
memory will be allocated at runtime. how the compiler will calculate structure size with out structure padding?