char string2char(String ipString){
char opChar[ipString.length() + 1];
memset(opChar, 0, ipString.length() + 1);
for (int i = 0; i < ipString.length(); i++)
opChar[i] = ipString.charAt(i);
}
Called as char charssId[AP_NameString.length()+1] = string2char(AP_NameString);
What is the right way to call the function? Want to change String ssid to char ssid, to make it compatible with esp8266 library.
This line is will not work. Because
char charssId[AP_NameString.length()+1]this means you are declaring an array of certain size and at the same time replacing it with the returned array from the method.You can do as follows,