#define names are visible to the compiler at compile-time, but don't exist at
runtime. And names are not the same thing as strings (which are runtime
objects).
You need an array of int or byte:
#define RELAY1 4
#define RELAY2 5
#define RELAY3 6
#define RELAY4 7
#define RELAY5 8
#define RELAY6 9
#define RELAY7 10
#define RELAY8 11
byte relays[] = {RELAY1, RELAY2, RELAY3, RELAY4, RELAY5, RELAY6, RELAY7, RELAY8};
void setup ()
{
for (int i=0; i = 7; i++){
pinMode (relays[i], OUTPUT);
digitalWrite (relays[i], LOW);
}
..
}
Whitespace serves only to separate names, it is ignored:
const char *relays[]
parses the same as
const char* relays[]