Character arrays in a Structure
Hello All,
I am a little confused about a usage that I have seen in "Unix Network Programming" by Richard Stevens. There a structure was declared as follows...
struct somename
{
some variables;
char msg[1];
};
and then he later used the msg variable to accommodate larger strings. I heard this is a common usage (declaring a character array of 1 byte long and using it to store larger strings, but I really am not getting how it is possible? I mean, will that not be over-writing memory that does not belong to this structure? Please guide.
Regards,
Harsha.