If your "int *" is simply a pointer to a single int that is going to change, use "ref int" in your C# DllImport statement and "int *" in your C function.
Passing arrays back and forth between C# and C requires explicit marshalling. An example for an array of int32_t (when marshalling, it is always advisable to use explicity-sized things):
[[DllImport ("dll.dll", Calling Convention = CallingConvention.Cdecl)]
private static extern void A_Function (IntPtr arrayPtr, int arraySize);
IntPtr unmanArray = Marshal.AllocHGlobal (300 *sizeof (Int32));
A_Function (unmanArray, 300);
Int32 manArray = new Int32;
Marshal.Copy (unmanArray, manArray, 0, 300);
The corresponding C code is the expected
void A_Function (int32_t * arrayInts, int arraySize);
I always pass an array size when going between C and C# -- it avoids buffer overruns to have an explicit size in the C code.
The same principle applies to an array of anything other base type (float, double, byte).
please note - if you have any more questions, be warned that my responses will be slow in
coming but i'll try to help.