C# What is the difference between byte[] and char[] [closed]
What is the difference between byte[] and char[]?
Differentiate more from usage perspective. Can they be used interchangeably?
byte
represents a byte. It is always 8-bits wide. char
represents a unicode character, and thus is two bytes (i.e. 16 bits) wide. Use byte[]
if you're dealing with raw bytes, and char[]
(or better yet string
) if you're dealing with strings.
精彩评论