a style question

Dan Bernstein brnstnd at kramden.acf.nyu.edu
Mon Oct 1 12:57:15 AEST 1990


In article <8660 at ncar.ucar.edu> steve at groucho.ucar.edu (Steve Emmerson) writes:
> 	# define NUM_ELEMENTS	100
> 	for (x = 0; x < NUM_ELEMENTS; x++) ...

Hmmm. I'll automatically write x = NUM_ELEMENTS; while (x--) ... for
this kind of loop. On many computers it'll run noticeably faster, and I
can safely replace NUM_ELEMENTS by a function call.

---Dan



More information about the Comp.lang.c mailing list