I'm having some difficulty assigning a value to a variable in a struct array outside the loop and setup functions. Assigning a value to an int or char array works completely fine but this doesn't.
The example code and error message returned after trying to compile are below. Any help is greatly appriciated. Thanks
void setup()
{
}
struct trap_game_detail {
byte flush_quantity;
byte flush_interval;
byte random_min;
byte random_max;
byte random_quantity;
} trap_game_details[2];
trap_game_details[0].random_min = 1;
void loop()
{
}
src/sketch.ino:13:5: error: ‘trap_game_details’ does not name a type trap_game_details[0].random_min = 1; ^ .build/uno/Makefile:166: recipe for target '.build/uno/src/sketch.o' failed