What i'm trying to learn is whether using C++ method parameters as
pass by reference is possible or not?
Yes, it is possible. Use int*
on the C++ side and ref int
on the C# side. You should be able to write to that parameter from C++ and it will update on the C# side.
See this answer from my other post for a complete example.
What i'm trying to do is getting size of uchar* array returned by c++
code.
You can with the example above. If you care about performance, do not return array from C++. Create the array in C# then pass it to C++ and modify it there. See the linked answer for information.