Go Down

Topic: Call function from an array (Read 272 times) previous topic - next topic

Chaos_Lord

Hello everyone,

is it some how possible to call funktion from an array?

What i want to do is a Systemcheck depending on some events which happens. These events write data in an Array

char* syscheck[] = {"Timer" , "Sensor"};

syscheck now has the names of the funkctions which should be called.

Do i have to check every entry per hand and when it is in the array call the function "per hand" or can i somehow do a call direktly?

CL

PS my english is bad, so sorry for it   :~

AWOL

Yes, you can have an array of function pointers, but these are not the same as strings.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Arrch


Chaos_Lord

Thanks for the quick answers,

i tried to work as the exaple shows, but always get
Quote
invalid conversion from 'void (*)() to 'void*'


when i try compiling it with arduino

Arrch


Thanks for the quick answers,

i tried to work as the exaple shows, but always get
Quote
invalid conversion from 'void (*)() to 'void*'


when i try compiling it with arduino


There were multiple examples, so without seeing the exact code you are using and what line that refers to, it's a bit difficult to say...

Go Up