Reputation: 6030
Whenever I try to directly assign a String variable to another String variable I get error found no suitable conversation.
So is there a way to convert String^ pointer to a non-pointer struct String ?
I want :
System::String a = System::String('X',256);
I don't want :
System::String^ a = %System::String('X',256);
Upvotes: 1
Views: 4376
Reputation: 283713
No, there is not, because as Hans pointed out in a comment, System::String
is immutable. You cannot assign it. You can only associate a handle with an entirely new System::String
object.
BTW
System::String^ a = %System::String('X',256);
is incorrect, it should be
System::String^ a = gcnew System::String('X',256);
Upvotes: 3