|
-
October 29th, 2012, 02:56 PM
#1
unsigned char array pointer to C# equivalent - marshalling
I have some C code which will be called from C# using P/Invoke. I have a C struct member for which I am trying to define an C# equivalent.
Array16 *data;
typedef unsigned char Array16[16];
How do I define the C# equivalent of this C data member?
-
October 30th, 2012, 02:55 PM
#2
Re: unsigned char array pointer to C# equivalent - marshalling
Not sure about this one, try System.UIntPtr
-
October 30th, 2012, 03:45 PM
#3
Re: unsigned char array pointer to C# equivalent - marshalling
CSharp uses the unsafe keyword as you know to allow you to use pointers. Unsafe code is very C-Like. This is done to allow inter-op with Win32 and other external C/C++ libraries and memory mapped devices. Other than that, you can make pointers to the built in types, that are also classes.
http://msdn.microsoft.com/en-us/libr...=vs.71%29.aspx
HTH,
ahoodin
To keep the plot moving, that's why.

Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|