Suppose someone has made individual functions in the following way separately for each person:
void John_age(void);
void Tom_age(void);
void Kate_age(void);
void Cathy_age(void);
....................
to determine their age.
Now I want to make such a function to call those functions by using just the person's names, like:
void age(char* NAME){...}
to call the specific function for that person "NAME".
void NAME_age(void);
is there any easy way to do that in C++ or C? I would really appreciate your help. Thanks.
The IDE i am using for a microcontrolles makes executable functions in the format void X_functionName(void);
for every individual pin X
. so I was looking for a more general approach to call them easily using functions like void customName(const char* X)
.