Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
JoachimSchipper
on Oct 15, 2011
|
parent
|
context
|
favorite
| on:
What is your favourite C programming trick?
Signed integer overflow is undefined, so make sure you're using an unsigned type in your ringbuffer example. (And an array with some-power-of-2 elements; you should probably use sizeof(array)/sizeof(<star> array) instead of ARRAY_SIZE too.)
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: