"Numerical Recipes in C" is nonportable code

Damian Cugley pdc at otter.hple.hp.com
Wed Aug 31 06:18:02 AEST 1988


... if you want to index an array starting at one, but

	int	b[4], *bb = &b[-1];

and variations thereof are interdit, why not use

	int	bb[5];

Before I am flamed to death for wasting *four* *whole* *bytes* of memory,
I think I can claim excemption under the `speed-vs-space' banner.
Using a pointer as an array probably involves an extra instruction or
CPU cycle somewheres - and `#define bb(x) (b[(x)-1])' does countless
`invisible' subtractions...

pdc



More information about the Comp.lang.c mailing list