Jak w C++/CLI przeksztaucić tablicę String^ na tablicę Char?
0
0
// test.cpp : main project file.
#include "stdafx.h"
#include <vcclr.h>
using namespace System;
int main(array<System::String ^> ^args)
{
String^ str = "dupa";
array<wchar_t>^ arr = gcnew array<wchar_t,1>(str->Length);
interior_ptr<wchar_t> ptext = interior_ptr<wchar_t>( PtrToStringChars(str) );
for(int i=0; i<str->Length; i++, ptext++)
arr[i] = *ptext;
for(int i=0; i<arr->Length; i++)
Console::Write(arr[i]);
return 0;
}
P.S. Nie pytałeś o to na CG?