Help with FastMaArray / SlowMaArray

 
In comparing MA,  if(FastMaArray[0]>SlowMaArray[0] && FastMaArray[1]<(SlowMaArray[1]), please ,what will cause -'0 some expected operator.
 

It is probably caused by the extra "(" in the code, but it depends on the context of your code (i.e. the rest of the code).

if( FastMaArray[0] > SlowMaArray[0] && FastMaArray[1] < ( SlowMaArray[1] )

You probably meant the following ...

if( FastMaArray[0] > SlowMaArray[0] && FastMaArray[1] < SlowMaArray[1] )
 
Fernando Carreiro #:

It is probably caused by the extra "(" in the code, but it depends on the context of your code (i.e. the rest of the code).

You probably meant the following ...

Thank you 
 
Write self-documenting code
   bool  isUp   = FastMaArray[0] > SlowMaArray[0];
   bool wasUp   = FastMaArray[1] < SlowMaArray[1];
   bool isCross = isUp != wasUp;
if(isCross)
Reason: