Feng26

Hi,

I am new to C++ .Net and currently running into a problem of type conversion.

I have a unsigned char __gc[] and I need to convert it into a char[]. How do I do that

Thanks for your help!

Feng



Re: Visual C++ Language How to convert unsigned char __gc[] to char[]

Alex Farber

To convert managed and unmanaged arrays of primitive types, use different Marshal::Copy overloads.



Re: Visual C++ Language How to convert unsigned char __gc[] to char[]


Re: Visual C++ Language How to convert unsigned char __gc[] to char[]

Feng26

Thank you so much Jiang for the links. The "method number 2" of your sencond link solved my problem.

Really appreciate your help!

Feng





Re: Visual C++ Language How to convert unsigned char __gc[] to char[]

Feng26

Thanks Alex for your help. The solution you recommended makes a lot of sense. It's just my ignorance on C++ that I didn't make it work before finding another way arround.

Feng