size of char type in c#

A char is unicode in C#, therefore the number of possible characters exceeds 255. So you’ll need two bytes.

Extended ASCII for example has a 255-char set, and can therefore be stored in one single byte. That’s also the whole purpose of the System.Text.Encoding namespace, as different systems can have different charsets, and char sizes. C# can therefore handle one/four/etc. char bytes, but Unicode UTF-16 is default.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)