I have the following function in C#.
public static string[] StringValue()
{
.....
return MyString;
}
I am trying to call the function in C++ using,
array<String^>^ MyString;
MyString = MyClass.StringValue();
for(int iter=0; iter < MyString->Length; iter++)
{
printf("%s", MyString[iter]);
}
The Value of MyString[iter] is not coming properly. It is proper in C# while debugging. The Length of MyString is coming proper but not the value.
for eachsyntax in C++/cli. And don't mix C++ or C calls without marshaling the data-type to the correct type.