Byte Array not compatible.

B

Bill

Can someone tell me how to get the below code working please.

System::Byte * enced = new byte[Data->Length];
///.. copy data in to array. (omitted)...
//Now pass to memory stream constructor
MemoryStream * ms = new MemoryStream(enced );

I get an error
cannot convert parameter 1 from 'unsigned char __gc *' to 'int'
 
W

Willy Denoyette [MVP]

This - System::Byte * enced = ...
declares a pointer to a Byte, this is not what you want,
Here is how to declare arrays
System::Byte enced[] =
// or explicitely qualify the array as managed
System::Byte enced __gc[] =

Willy.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top