calling a function from a string

is it possible to call a function from a string???

im using a 7 segment display and i made a list with the name of the functions, my question is, can i call them from the list???

char numbers[10][20]={"zero", "one", "two","tree", "four", "five", "six", "seven", "eight", "nine"};
int x =500;
int b=0;

void setup() {                
  DDRD =B11111100;
  DDRB =B111111;
}

void loop() {
  /* for (b=0;b<=9;b++){
   numbers[b]();      <=== i know this is wrong but i wanna know how to make it right
  delay(x);
  }*/
  zero();
  delay(x);
  one();
  delay(x);
  two();
  delay(x);
  tree();
  delay(x);
  four();
  delay(x);
  five();
  delay(x);
  six();
  delay(x);
  seven();
  delay(x);
  eight();
  delay(x);
  nine();
  delay(x);
  
  }
  
  
void zero(){
    PORTD=B11011100;
  PORTB=B000001;

}
void one(){
  
  PORTD=B01000100;
    PORTB=B000000;
}
void two(){
   PORTD=B10101100;
  PORTB=B000001;
}

void tree(){
    PORTD=B11101100;
  PORTB=B000000;
}

void four(){
     PORTD=B01110100;
  PORTB=B000000;
}

void five(){
  PORTD=B11111000;
  PORTB=B000000;

}

void six(){
  PORTD=B11111000;
  PORTB=B000001;

}

void seven(){
  PORTD=B01001100;
    PORTB=B000000;

}

void eight(){
    PORTD=B11111100;
  PORTB=B000001;
}
void nine(){
  PORTD=B11111100;
  PORTB=B000000;
}

No, but if you know the number, you can make arrays with the data.

const int codeB[] = { B000001, B000000, ... };
const int codeD[] = { B11011100, B01000100, ... };

The loop can be like this:

  for (b=0;b<=9;b++) {
    PORTD = codeD[b];
    PORTB = codeB[b];
    delay(x);
  }

At runtime a function is presented by a pointer-to-function, and those can
be placed in an array

void (*fnarray[])() = { loop, setup, loop } ;

The strings naming the functions no longer exist in the runtime model (except
for linking purposes, which is not reflected to the runtime system).

MarkT:
At runtime a function is presented by a pointer-to-function, and those can
be placed in an array

void (*fnarray[])() = { loop, setup, loop } ;

The strings naming the functions no longer exist in the runtime model (except
for linking purposes, which is not reflected to the runtime system).

But a better more useful example would to show how it would work with his code.
i.e.:

void (*numbers[])() = { zero, one, two, three, four, five, six, seven, eight, nine } ;

Then this line will work:

numbers[b]();

The numbers array is declared to contain an array of pointers.
The array is automatically sized based on the number of pointers/functions provided.
b will index into the numbers array to find the correct function pointer to be called.

--- bill