calling for random function inside class?

I have a class with public functions but I want to be able to call one of the four functions, randomly. How could I approach this?
You can make a function like this:
1
2
3
4
5
6
7
8
9
10
11
12
13
void call_rand_func ()
{
     switch ( rand() % 4 ) // get a random number
    {
         case 0:
            first_function(); // call a function according to that
            break;
         case 1:
            second_function();
            break;
         // etc.
    }
}
Topic archived. No new replies allowed.