copy specified length of array char^ to char* [modified]
-
Hi everybody I have a dll in C++ which I want to use it in C# later. I want to have a Char array in the interface of a function. So the interface is like: function(array char^ chArr) I have a char* "ch" it in function body which I want to copy a specified length of it in chArr.I wrote a code like this: memcpy(chArr,(const char*)ch,length) But it can not convert from array^ to void* (the first parameter of memcpy is void*). What should I do? Thnx in advance
modified on Sunday, August 30, 2009 1:13 AM
-
Hi everybody I have a dll in C++ which I want to use it in C# later. I want to have a Char array in the interface of a function. So the interface is like: function(array char^ chArr) I have a char* "ch" it in function body which I want to copy a specified length of it in chArr.I wrote a code like this: memcpy(chArr,(const char*)ch,length) But it can not convert from array^ to void* (the first parameter of memcpy is void*). What should I do? Thnx in advance
modified on Sunday, August 30, 2009 1:13 AM
Use pin_ptr[^] - here's an example[^]
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p