Mail Archives: djgpp/1997/03/11/09:25:08
James Shatto (Jcs DOT Shadow AT postoffice DOT worldnet DOT att DOT net) wrote:
: I'm trying to learn C and C++... I've written this in C and when it's
: compiled, I get an array subscript not an integer. Any
: suggestions...???
: #define NUMH 96
: float height_table[NUMH] = {75.23, 75.35, 75.48, 75.60,
: 75.72, 75.84, 75.96, 76.09,
: 76.21, 76.33, 76.45, 76.56,
: 76.68, 76.80, 76.92, 77.04,
: that's part of the data...
: when I try to use it with the following, it gives the error.
: array subscript not an integer. I'm compiling with the gcc of djgpp...
: strtoul(height_table[hf],NULL,hmf);
: hmf = height_table[hf];
: both of these return the same error, hmf and hf are float integers.
: Please help...I can't get this thing to work...
`float integers'? float is a floating point (real) number, int is an integer
(whole number). There is no such thing as a float integer. Array subscripts
have to be of an integer-compatible type, which float isn't, so change hf
to type int, if possible.
If you are still confused, send me a longer code sample and I'll show you
what to change.
--
George Foot <gfoot AT mc31 DOT merton DOT ox DOT ac DOT uk>
Merton College, Oxford.
- Raw text -