How Structs Really Work in C
tenaciousc.com
How Structs Really Work in C
1–10 of 14 posts
Re: How Structs Really Work in C
#2Re: How Structs Really Work in C
#3Wouldn't the zero-length array potentially run into other memory?
edit: I suppose one could use for globals or on the stack by casting a byte array ... I would find that to be unspeakably ugly but I don't write much C.
Re: How Structs Really Work in C
#4Wouldn't the zero-length array potentially run into other memory?
C99 has its own "zero sized array" thing but it is a different syntax.
Re: How Structs Really Work in C
#5Wouldn't the zero-length array potentially run into other memory?
Re: How Structs Really Work in C
#6Re: How Structs Really Work in C
#7Re: How Structs Really Work in C
#8"You don't know it yet, but you're...wrong."
I really really hate it when a posting starts off like this, then proceeds to tell me something anyone who considered themselves a C programmer would know.
Want to write a post about something kind of neat that people outside the field might not be up on? Cool, have fun. But don't start it out by being a rude ass. And this guy dedicates the first hundred words or so of his article to it.
Re: How Structs Really Work in C
#9Re: How Structs Really Work in C
#10Also,
> size_t offset = (size_t) &(((struct s*)0)->thing);
In what universe is that code "ugly"?