I am trying to initialize character arrays allocated from the
managed heap (CLI), then access the individual elements within
those arrays. Is there any way that I can do what I am trying
to do without resorting to using String objects?
This is what I have tried, and the associated compilation diagnostics:
===========================================================
Test-01.cpp
wchar_t^ wcstr = gcnew wchar_t { L"zxcasdqwe" };
Test-01.cpp(70) : error C2440: 'initializing' : cannot convert from
'wchar_t *' to 'System::Char ^'
No user-defined-conversion operator available, or
Cannot convert an unmanaged type to a managed type
Test-01.cpp(71) : error C2440: 'initializing' : cannot convert from
'const wchar_t [10]' to 'wchar_t'
There is no context in which this conversion is possible
Test-01.cpp(71) : error C2440: 'initializing' : cannot convert from
'cli::array<Type> ^' to 'System::Char ^'
with
[
Type=wchar_t
]
No user-defined-conversion operator available that can perform this
conversion, or the operator cannot be called
Test-01.cpp(87) : error C2676: binary '++' : 'System::Char ^' does not define
this operator or a conversion to a type acceptable to the
predefined operator