L
Louis Caron
I am facing the following problem:
- I have to build a const array containing functions pointers
- the indexes for this array are generated automatically by a tool (not my property)
How do I make sure that all of a sudden, the tool does not generate the indexes with a different order?
My first solution would have been to perform such kind of initialization:
typedef int (*func_ptr)(void);
const func_ptr func_array[MAX_INDEX];
{
func_array[AN_INDEX] = foo_an;
func_array[ANOTHER_INDEX] = foo_another;
func_array[MORE_INDEX] = foo_more;
}
but his does not work... can I initialize the array by specifying the array index(slicing?) ?
Thanks
Louis
- I have to build a const array containing functions pointers
- the indexes for this array are generated automatically by a tool (not my property)
How do I make sure that all of a sudden, the tool does not generate the indexes with a different order?
My first solution would have been to perform such kind of initialization:
typedef int (*func_ptr)(void);
const func_ptr func_array[MAX_INDEX];
{
func_array[AN_INDEX] = foo_an;
func_array[ANOTHER_INDEX] = foo_another;
func_array[MORE_INDEX] = foo_more;
}
but his does not work... can I initialize the array by specifying the array index(slicing?) ?
Thanks
Louis