Go Down

Topic: toCharArray() reference description should mention that \0 is added to the end (Read 67 times) previous topic - next topic

whyameye

https://www.arduino.cc/en/Reference/StringToCharArray

It would be helpful if the description mentioned that \0 is added to the end of the buffer.

pYro_65

It might be better for people unfamiliar with char arrays. I can raise an issue for you.

If you do not need a copy of the data, just use string.c_str(). It will save a lot of overhead.

char *ptr = string.c_str();

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy