N
Nanditha Chandra
Hi!
I am new to Managed C++ and am working on my first project with this.
In native C++, we could have a function that takes void* and call that
function with any type. Is there a way to do that with MC++? If I had
something as follows in native C++,
Foo(void* arBuf, int nSize);
And this can be called as follows
int* nBuf = new int[nSize];
Foo(nBuf, nSize);
long* nBuf2 = new long[nSize];
Foo(nBuf2, nSize);
How would I do something like this in MC++? I have an array of Byte
and int (and possibly others as well). And I need to pass this to a
function which can handle both (Similar to the Foo function above). I
am not sure how that Foo function has to be defined in MC++?
Also an additional question - What exactly is IntPtr? Is it void
equivalent?
Thanks,
D
I am new to Managed C++ and am working on my first project with this.
In native C++, we could have a function that takes void* and call that
function with any type. Is there a way to do that with MC++? If I had
something as follows in native C++,
Foo(void* arBuf, int nSize);
And this can be called as follows
int* nBuf = new int[nSize];
Foo(nBuf, nSize);
long* nBuf2 = new long[nSize];
Foo(nBuf2, nSize);
How would I do something like this in MC++? I have an array of Byte
and int (and possibly others as well). And I need to pass this to a
function which can handle both (Similar to the Foo function above). I
am not sure how that Foo function has to be defined in MC++?
Also an additional question - What exactly is IntPtr? Is it void
equivalent?
Thanks,
D