Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
bertr4nd
on Nov 22, 2020
|
parent
|
context
|
favorite
| on:
What is your favorite C programming trick? (2009)
Zero-length arrays, used to implement a variable-sized structure with header:
https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
. Although apparently it’s a GCC extension, which I didn’t realize until now.
kevin_thibedeau
on Nov 23, 2020
[–]
C99 made it official with "type foo[];" syntax. Better than using "type foo[1];" and potentially adding unnecessary padding.
Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: