0

In reference code NDP/clr/src/BCL/System/Char.cs:

public struct Char : IComparable, IConvertible
{
    //
    // Member Variables
    //
    internal char m_value;

But isn't char an alias of System.Char? I'm confused.

Giorgi Nakeuri
  • 35,155
  • 8
  • 47
  • 75
brian
  • 265
  • 1
  • 9
  • 1
    What is your question exactly? Yes, `char` is an alias for `System.Char`. Are you asking something like how `Char` can have a field as typed itself? I'm sure there is a duplicate of this question for `Int32` type but as always I couldn't find it. – Soner Gönül May 27 '15 at 06:48
  • The CLR has special knowledge of some types. Their cs source isn't necessarily reflective of reality. – Damien_The_Unbeliever May 27 '15 at 06:49
  • so does that mean each Char instance has another Char instance "m_value" embedded inside it? – brian May 27 '15 at 06:49
  • @SonerGönül Yes. That's what confusing me. – brian May 27 '15 at 06:51
  • @Damien_The_Unbeliever Does that mean the type "char" of "m_value" is not an alias of System.char but some internal char type? – brian May 27 '15 at 06:52

1 Answers1

0

char is a C# type that matches the .NET type System.Char.

See a list of built-in C# types and their corresponding .NET types: https://msdn.microsoft.com/en-us/library/ya5y69ds.aspx

Marius Bancila
  • 16,053
  • 9
  • 49
  • 91