I was appalled at the Stack Overflow answer; thankfully the author corrected it. This sort of exercise is a first homework assignment in a computer architecture course.
It's worth remembering that C is an abstraction. Even assembly is an abstraction. If you care about performance, you need to understand the limitations of the abstraction level you're working at - where your abstraction leaks, and what it is that leaks through.
It's worth remembering that C is an abstraction. Even assembly is an abstraction. If you care about performance, you need to understand the limitations of the abstraction level you're working at - where your abstraction leaks, and what it is that leaks through.