[comp.lang.c] How to handle nonintuitive array indices?

rjain@acsu.buffalo.edu (Rajeev Jain) (04/30/91)

I am developing a substantial package in C which would be used by an
audience that is familiar enough with computers but is not necessarily
a worshipper of C.  There are many arrays and I expect considerable
user interaction based on the array indices.  For example, the
following may appear as output:

The following are the species biomasses:

Species #  biomass(gC/m^3)
1.         2.01 
2.         45.80
3.         21.09

and so on...


Now my question.  Real world users, me included, like to think of
serial numbers starting from 1.  I could make sure all output adds one
to the array index before printing.  While this would make the program
user friendly, it would make it extremely frustrating to debug and
reprogram based on the output information.  This is serious because
each species in my program is identified by many numbers depending on
what characteristic of that species is being talked about.

This must be a common enough problem and I haven't seen it mentioned
on the group before.  Let me know your comments.  Is it a constant
pain for developers?  Are there standardized ways to tackle it?

I would summarize any emails received.

-- 
---
Rajeev Jain	rjain@acsu.buffalo.edu