I was wondering if it was possible to use a reference or pointer as an argument to a function in EasyC V4?
For example:
void MyFunction (char &a,char &b)
{
a=5
b=10
}
In this case, I would like it so that whatever variables i used for the arguments would end up containing 5 and 10 respectively.
Thanks
EDIT//
Also, does EasyC include some kind of function like
IsOperatorControl();
or
IsAutonomous();
that tells you what mode the robot is in?
Thank you, that helps a ton!
As far as my second question goes, is there any built in function that identifies if the robot is in aunonomous or operator control? I’m loooking for something like the IsEnabled() function.
There is an IsAutonomous() function (undocumented) that may work, otherwise set a global variable at the start of autonomous or operator control functions.
Do you know if IsAutonomous() is true even if the robot is disabled? Or is it only true when the robot is enabled and in autonomous mode? I just don’t have a cortex at home to test it with.
The function returns 0 during OperatorControl and 1 during Autonomous, it always returns 0 during Initialize so will not tell you what is going to happen when the robot becomes enabled. This is the same behavior as ROBOTC so is probably determined by the master processor.