I have a piece of code that I want to run only if certain conditions are true for elements in an array. Currently, I have to know the length of the array for any of the code to work, but my end goal is to have it work for an array of any length.
My current code:
if (rand[0] == someInt && rand[1] == someInt && . . . && rand[n] == someInt) {
*do some things*
}
I want this to work not knowing the length of rand[].
Thanks in advance.
Aucun commentaire:
Enregistrer un commentaire