I'm having an error signing an array:
Menu m = Menu();
m.Options[4] = {"teste1","teste2","teste3","teste4"};//Erro aqui
m.Show();
Menu Class:
class Menu
{
public:
String Options[];
int index = 0;
int len = 0;
String Show()
{
while(controller.Button == 0)
{
len = sizeof(Options)/sizeof(Options[0]);
index = index + controller.Left;
if (index < 0)
index = len;
if (index > len)
index = 0;
display.setCursor(0,00);
Clear();
display.println(Options[index]);
DrawBuffer();
}
return Options[index];
}
};
I already tried:
m.Options[] = {"teste1","teste2","teste3","teste4"};
and m.Options = {"teste1","teste2","teste3","teste4"};
,
It also did not work.
Home
This is the error: no match for 'operator=' (operand types are 'String' and '<brace-enclosed initializer list>')
I'm a beginner in C.