I have an array of zero cell and i want to dispay his size. my code is:
#include <stdio.h>
#include <string.h>
#include <stdint.h>
typedef struct ts_ff {
uint8_t reserved[0];
} TS_fact;
int main(void) {
TS_fact ts_factory;
printf("size of reserved is %zu Bytes\n",sizeof(ts_factory));
return 0;
}
But the return of this code return 0 Bytes not 1 Byte for this array cell.
size of reserved is 0 Bytes
Why the compiler do this ?