TheNegative
TheNegative

Reputation: 316

using gcnew as a copy constructor

i know that gcnew is used to allocate managed memory. i also didn't find any System::String(System::String ^)constructor. normally if you want to copy a System::String class you will use something like

System::String ^s1 = gcnew System::String("a");
System::String ^s2 = System::String::Copy(s1);

but what about this?

System::String ^s1 = gcnew System::String("a");
System::String ^s2 = gcnew System::String(s1);

Upvotes: 1

Views: 432

Answers (0)

Related Questions