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 2007-09-17 7:47 ID:gf4kBNCr

>>76
What is the use of a loop that doesn't check when to finish?
while(!finished)
  finished = true;

for(;;)
  if(cond)
   break;

I've seen cases where usage of break is more elegant than using vars and while. Such cases are exceptional.

>>77
Guess where the theory behind computer science comes from? Oh, that's right, it doesn't come from the people that formalized cs theory, it comes from EXPERT PROGRAMMERS

>>78
I love GOTO roughly like a noodly spaghetti code.

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