Using for loop to set pinMode I notice problems with my output pins when I use this method of setting their pinMode:

int allOutputPins[] = {3, 4, 9, 10, 5, A3, 11, 12, 7, 8, A1, A2};


for(int a = 0; a &lt; sizeof(allOutputPins); a++){
   pinMode(allOutputPins[a], OUTPUT); 
  }//end for


Am I doing something wrong?
Re  “Am I doing something wrong?”, yes :)

The sizeof(allOutputPins) expression returns the size of allOutputPins[] in terms of bytes, so is 24 because the array contains 12 two-byte integers.  The loop's last 12 pinMode() calls will be garbage.

Among other ways of fixing the problem, you could change the expression to sizeof(allOutputPins)/sizeof(int) [which has the same value, 12, as (sizeof allOutputPins)/sizeof(int); eg see the syntax entries for the sizeof operator at cppreference.com] or you could change the base type of the array to byte or uint8_t.