array of function pointers in robotC

  1. 7 months ago

    I have an array that should populate with pointers to other functions. The way robotC handles this seems to be different than other c/c++ compilers i have used. given this variable:

    void *autonFuncs[AUTON_NUMBER] = { &auton30ptRight, &auton30ptLeft,
                                       &auton11ptRight,  &auton11ptLeft
    };

    I get this error**Error**:Internal Compiler: Unexpected use of proc 'auton30ptRight' in an expression for each of the function pointers.

    how would i evaluate, for example auton30ptRight and am i even initializing this right, normally i would need () around the variable name but here it gives an error.

    Thanks in advance

    As far as I'm aware RobotC does not support function pointers. It lacks many of the more advanced features from c and definitely from c++.

  2. Andrew Strauss

    13 Nov 2017 Answer Ontario, Canada 5225A Mentor

    As far as I'm aware RobotC does not support function pointers. It lacks many of the more advanced features from c and definitely from c++.

  3. @Andrew Strauss As far as I'm aware RobotC does not support function pointers. It lacks many of the more advanced features from c and definitely from c++.

    I feared as much, yet another reason to use PROS. Thanks for the clarification.

 

or Sign Up to reply!