calling a random function number I have a recurring problem that when I'm controlling leds, I make several different functions for different fx and just want to trigger them randomly but having a hard time to formulate it in an intelligent way and end up hardcoding every function call.

ex: I have let's say 10 functions called anim1();, anim2();, anim3(); etc 
and would like to called them randomly in that fashion :

randNumber = random(1,11);
anim[randNumber]();


I know that it's not that type of brackets I need to use but I can't find the proper syntax and I'm wondering if it's possible to do that..
I'm sure there must be a way ;)

thanks for your help
What you want is an array of function pointers.

void anim1() {
    // blah blah
}

void anim2() { 
    // blah blah
}
// ... etc ...

typedef void (*animptr)();

animptr anims[10] = {
    anim1,
    anim2,
    anim3,
    // ... etc ...
    anim10
};


Then you can use:

anims[animNumber]();