I'm trying to set a string to be different things depending on an int, but when I declare a string in any if statement, even an always true one it seems to give me error: 'correctColor' undeclared (first use in this function).
If I have this line by itself, my code works fine.
char correctColor[] = "red";
But if I have something like
bool test = true;
if(test){
char correctColor[] = "red";
}
it gives me the error above. Any help is greatly appreciated.