Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

C programming tricks

Name: Anonymous 2007-09-15 22:06 ID:WCtjqT0N

While programming optimization that makes ones' code completely unreadable is often a bad thing, there are places for it, like that one inner loop of your code that takes up 98% of the program's running time.

What are you tricks for improving performance in C, other than the obvious inline assembly or the like?

Name: Anonymous 2008-01-09 3:33

>>125,128
It's random() anyway so the point is doug moot. But most compilers defer postfix ops until the whole expression has been evaluated (I only wish it was in the standard)

Here's a tricky bit of code that is valid but most people won't think so:

int i=0;
i++ && i++ || i++ && i++


What's the value of i after the above fragment executes?

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List