Unable to find string literal operator 'operator“”redmi' with 'const char [11]', 'unsigned int' arguments

Im trying to connect my proteus to wifi using Esp8266 and arduino im compiling this in arduino ide. but the problem is in the field where i should provide the ssid and password its saying this message unable to find string literal operator 'operator""redmi' with 'const char [11]', 'unsigned int' arguments i've tried String cmd="AT+CWJAP= " redmi 2","12345678""; using spaces but then it says missing ","or";" before redmi Please if anyone can help.

void setup()

{ const char* redmi;

Serial.begin(9600);

pinMode(MOS_SEN, INPUT);

pinMode(LDR_SEN, INPUT);

pinMode(RM_1, OUTPUT);

pinMode(RM_2, OUTPUT);

ser.begin(9600);

// reset ESP8266 WiFi connection AT+CIPMUX=1 AT+CWJAP

/========================================================================/

/*AT commands for establishing WiFi connection */

/========================================================================/

ser.println("AT");

delay(1000);

ser.println("AT+GMR");

delay(1000);

ser.println("AT+CWMODE=3");

delay(1000);

ser.println("AT+RST");

delay(5000);

ser.println("AT+CIPMUX=1");

delay(1000);

String cmd="AT+CWJAP="redmi 2","12345678"";

ser.println(cmd);

delay(1000);

ser.println("AT+CIFSR");

delay(1000);

}

Please post your complete sketch following the advice in How to get the best out of this forum

At the start of the setup, when you do

you create a local variable that is not initialized, so the pointer just points to garbage.

then you try to do
String cmd= "AT+CWJAP=" redmi 2 "," 12345678 "";
that just does not mean anything. (read about String concatenation and escape characters to insert double quotes within the text)

String cmd= "AT+CWJAP=\"" ;
cmd += redmi; // if redmi was propery initialized...
cmd += "\", \"12345678\"";

but that's allocating a String and doing dynamic allocation for little gain...

may be the easiest way to do this is just define the full command if you don't need the SSID elsewhere

#define cwjap  F("AT+CWJAP=\"SSID\",\"PWD\"")
...
  ser.println(cwjap);

Do you want spaces in the SSID and pw?