In C/C++ there is equivalence between char[] and char* : at runtime char[] is no more than a char* pointer to the first element of the array.
So you can use you char* where a char[] is expected :
#include
using namespace System;
using namespace System::Runtime::InteropServices;
void display(char s[])
{
std::cout << s << std::endl;
}
int main()
{
String^ test = L"I am a .Net string of type System::String";
IntPtr ptrToNativeString = Marshal::StringToHGlobalAnsi(test);
char* nativeString = static_cast(ptrToNativeString.ToPointer());
display(nativeString);
}
So I think you can accept Maurice's answer :)