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:
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:
- Is
takes character pointer as argument instead of character array pointer?String(Char*) - Or am I doing some mistake in declaring and initializing character array pointer?



