In String constructor `String(Char*)`, `Char*` is character pointer or character array pointer?
I was exploring
And one of the constructors is
Its description says: Initializes a new instance of the String class to the value indicated by a specified pointer to an array of Unicode characters.
However, I got error, when I tried following code to initialize string using pointer to an array of characters:
So, my question is:
1. Is
2. Or am I doing some mistake in declaring and initializing character array pointer?
System.String class here: https://learn.microsoft.com/en-us/dotnet/api/system.string?view=net-9.0And one of the constructors is
String(Char*)Its description says: Initializes a new instance of the String class to the value indicated by a specified pointer to an array of Unicode characters.
However, I got error, when I tried following code to initialize string using pointer to an array of characters:
So, my question is:
1. Is
String(Char*) takes character pointer as argument instead of character array pointer?2. Or am I doing some mistake in declaring and initializing character array pointer?



