Hi everyone,

I have created a function array. My question is, is it possible to dynamically populate the function array based on some criteria each time? I want to have a loop that will check some conditions and will adjust the function array accordingly. Thanks in advance

Code:
typedef void (*ReadSensor)(SensorResult *); //Create a function pointer datatype with the alias ReadSensor that returns void(nothing) and take as parameter structure pointer (SensorResult)




//Create three function prototypes that returns nothing taking as parameter the struct pointer SensorResult
void floatFunction(SensorResult *);
void byteFunction(SensorResult *);
void longFunction(SensorResult *);


ReadSensor sensorFunctions[] = { floatFunction, byteFunction, longFunction }; //Manually populate the array of fuction pointers with the functions addresses