dimanche 19 avril 2020

Array value as a condition

I have an array of integers called test containing 7 elements,I want to write an if statement to check if the 6 first values of the array are equal to a certain collection of values,what I tried was:

if (test == {1, 0, 1, 0, 0, 0} ) {
//statement(s)
}

However,the line containing the condition gives me an "expected an expression error",what am I doing wrong? Thanks in advance.

Aucun commentaire:

Enregistrer un commentaire