I need to transfer packets through the internet whose length should be dynamic.
struct packet
{
int id;
int filename_len;
char filename[];
};
The problem is that zero-length arrays are not ISO-compliant.
Should I use char filename[1];
instead? But then sizeof(struct packet)
will not return the correct value anymore.