What is the best way to convert an array of chars to bytes and vice versa?
Solution:
void CharToByte(char* chars, byte* bytes, unsigned int count){
There is no byte type in C++. You could typedef 'unsigned char' to 'byte' if that makes it nicer. Really thats all a byte is in C++ - an unsigned char. Aside from that, yes I would cast... but this cast is better:
unsigned_char_arr[i]= static_cast(char_arr[i]);
or... just use the char array and cast it when it needs to be interpreted as an unsigned char...