Creating address lookup table
Greetings all. I am fairly new to C (assembler programmer for years), so I have assembler processes in my head - which I am trying to translate to C.
I need to create a static lookup table which contains the address of a function and a bunch of other static parameters, thus:-
I then have a routine that decides which set of parameters to use. The routine loads in the values from the lookup table into variables - which are used in other parts of the program. The address of the "funct" goes into a pointer "void (*fnptr) (void)".
So the question(s) are:
1. How is the table created - what is the syntax for combining different static types?
2. How is each element in the table accessed by the accessing routine?
I have tried several different ways but the compiler wont have a bar of it.
Thanks in advance!