Char data type in C#

The char data type represents a single Unicode character. It stores a single character within single quotes ('). The char data type in C# uses the UTF-16 encoding and can represent characters from the Unicode character set.

Here's an example:


char myChar = 'A';
char anotherChar = '\u0065'; // Unicode escape sequence for 'e'

Console.WriteLine(myChar);          // Output: A
Console.WriteLine(anotherChar);     // Output: e

In the example above, we declare two variables myChar and anotherChar of type char and assign them character values. The char data type can store a single character, including alphabets, digits, symbols, and special characters.