Checking array's contents

Is there a way to check insides of array like this, ie. can this be done? Or is there another way?

int testing[10];

Start program:

testing[1,2,3,4]=1; // Does this set all those to 1?

If (testing[1,2,3,4]=1) //Does this check if all those values are 1? Serial.print("True];}

Thank you.


you can only do something like this when you declare the variable:

int testing [4] = {1,1,1,1};

No, you can't use that construct to test if all the contents are a particular value, you must use a loop. (unless you're using a string, in which case, use strcmp)

Ok, thanks.

For an array of byte (or uint8_t or char) you can use memset to set all elements to a value.

You can use memcmp to compare two arrays for equality.