declare a parameter

Hello
Anybody can help with?!

This is a part of my code
// Mode
tempflag = 0;
for (cnt3 = 0; cnt3 < 4; cnt3++)
{
if (strcmp(compare1[cnt3], appUartData.readString,9) == 0)
{
tempflag = 1;
switch ( cnt3 )
{
case 0:
{
appUartData.ModeAtflag=0;
SerialMon.println(" AT comands Disabled! ");
break;
}
case 1:
{
appUartData.ModeAtflag=1;
SerialMon.println(" AT comands Enabled! ");
break;
}
case 2:
{
appUartData.ModeAiflag=0;
SerialMon.println(" AIO comands Disabled! ");
break;
}
case 3:
{
appUartData.ModeDiflag=0;
SerialMon.println(" DIO comands Disabled! ");
break;
}
}

}

}
I got an error to define the compare 1!!!!!!
and that is defined as

char compare1[4] = { 'Mode at=0' ,'Mode at=1' , 'Mode ai=0' , 'Mode di=0'};

can anybody please help me to solve the problem?

thank you

char comparel[4] can only store four characters like maybe 'Mode'. You are trying to assign a multidimensional Array to an Array defined with only one Dimension.

Use:

const char * const compare1[] = {"Mode at=0" ,"Mode at=1" , "Mode ai=0" ,  "Mode di=0"};

First the ' (single quote) is for single characters ('A'). The " (double quotes) is for strings ("this is a string").

My best guess at what you want is an array of pointers to strings.

An example.

const char* compare1[4] = { "Mode at=0" ,"Mode at=1" , "Mode ai=0" ,  "Mode di=0"};

void setup()
{
   Serial.begin(115200);
   for(byte n = 0; n < sizeof(compare1) / sizeof(int); n++)
   {
    Serial.println(compare1[n]);
   }
}

void loop()
{

}

groundFungus:
First the ' (single quote) is for single characters ('A' or 'it').