Answer the question
In order to leave comments, you need to log in
Correct conversion of char[] to System::String
const int len=117;
char str[len];
memcpy(str,somechararray,len);
System::String^ clistr = gcnew System::String(str);
Answer the question
In order to leave comments, you need to log in
char str[len + 1];
memcpy(str,somechararray,len);
str[len] = 0;
System::String^ clistr = gcnew System::String(somechararray, 0, len);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question