I am creating a struct stored in a variable with the following code:
struct Options {
unsigned int COLOR_RED;
unsigned int COLOR_GREEN;
unsigned int COLOR_BLUE;
unsigned int COLOR_BLACK;
unsigned int COLOR_YELLOW;
unsigned int COLOR_WHITE;
unsigned int COLOR_ORANGE;
unsigned int COLOR_CYAN;
unsigned int COLOR_BRIGHT_RED;
unsigned int COLOR_LIGHT_GRAY;
unsigned int COLOR_DARK_GRAY;
unsigned int DEFAULT_BACK_COLOR;
String SD_PATH;
String SD_PATH_SETTINGS;
};
Options options;
.
However, when I try to set it from somewhere later in the program with this code: (optionInt is being set from the value of a text file)
unsigned int optionInt = 5; // just an example of what it could be
options.COLOR_RED = optionInt;
It comes up with this error: request for member 'COLOR_RED' in 'options', which is of non-class type 'String[50]'.
Why is this happening and how can I fix it? Thanks!
You didn't show the code that is causing the error, so how should we know? What I can tell you is that the compiler is right. Even when it's wrong, it's right. You do have to do it it's way.