"Swamy Muddu" <(EMail Removed)> wrote:
> Hi
>
> Is it possible to index an array using floating point numbers
> instead of integers (0 through n)?
IIRC arrays can't be indexed by nonintegral expressions (char, int, enum).
You could keep the number in a float and use a rounding function when you
want to index the array.
I have an array M in which
> one of the indices is a floating point number. Previously, I used
> a dirty work around for conversion of this index into an int
> (I found out that this is causing a loss in accuracy).
>
> map<> template in STL can be used to index arrays using strings,
> floats etc. Is there any implementation of map<> in C?
> Any help would be very helpful to me.
>
> Thanks in advance..
>
>  S Muddu
