If statement comparing array to value list throws error
You cannot compare like that... you have to do it one by one (and check the length of the array).

if ((sizeof(invest) / sizeof(bool) == 4) &amp;&amp;
    (invest[0] == 0) &amp;&amp; 
    (invest[1] == 1) &amp;&amp;
    (invest[2] == 0) &amp;&amp;
    (invest[3] == 0)) 
{
     ...
}


If you need to do such a compare often (with possibly different values), you of course can always write a dedicated function passing the array, and the array to check against and check the length and use a loop for checking all values.

Note that if invest is a boolean array, it's best to use false and true instead 0 and 1.