Hi,
I want to convert a String to a char pointer(in order to use it as wifi username and password).
I get a weird behaviour in my code and can't figure it out.
Both ssid and charArrayUsername are arrays of chars terminated with zeroes to turn them into C style strings. You cannot copy arrays like that, you need to use strcopy()
However, when you do
username.toCharArray(charArrayUsername, unlen);
then why not put the result directly into the ssid array ? You also need to think carefully about how the username array is terminated