This will work for an Arduino String object.
strcat( charArr, msg.c_str() );
The String object is msgconverted to an array of characters using the String c_str () method. Then you can use strcat () to add 2 character arrays.
As Rakete1111 mentioned, undefined behavior if charArrnot large enough
source
share