How do I convert a byte
array to a char
array in C#?
byte[] a = new byte[50];
char [] cArray= System.Text.Encoding.ASCII.GetString(a).ToCharArray();
From the URL thedixon posted
http://bytes.com/topic/c-sharp/answers/250261-byte-char
You cannot ToCharArray the byte without converting it to a string first.
To quote Jon Skeet there
There's no need for the copying here - just use Encoding.GetChars. However, there's no guarantee that ASCII is going to be the appropriate encoding to use.