Am I to understand that there is no effect by setting pin 0 HIGH or LOW?
No, pin 0 is a valid pin, so whatever is connected (such as your USB serial connection) would be affected.
What I meant to say was that for your purposes, you need to distinguish entries that are valid vs entries that are invalid.
#define NUM_ENTRIES 5
byte myPinNumbers[NUM_ENTRIES] = { 8, 9, 10, [glow]-1[/glow], 13 };
byte myDesiredOutputs[NUM_ENTRIES] = { HIGH, HIGH, LOW, [glow]LOW[/glow], HIGH };
int i;
for (i = 0; i < NUM_ENTRIES; i++) {
[glow]if (myPinNumbers[i] >= 0)[/glow]
digitalWrite(myPinNumbers[i], myDesiredOutputs[i]);
}
The highlighted parts look for "invalid" pin numbers and don't try to output anything for those entries.