如果我在c中的结构体定义如下
typedef struct Tcl_Interp {
char *result;
void (*freeProc)(char *blockPtr);
int errorLine;
} Tcl_Interp;其中void (*freeProc)(char *blockPtr)是一个指向函数的指针。
请问在c#中如何定义该结构体。
例如:
public class Tcl_Interp
{
const int RESULT_FULL_LEN = 0x200; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = RESULT_FULL_LEN)]
public string result;
//public IntPtr freeProc (string blockPtr);
int errorLine;
}
typedef struct Tcl_Interp {
char *result;
void (*freeProc)(char *blockPtr);
int errorLine;
} Tcl_Interp;其中void (*freeProc)(char *blockPtr)是一个指向函数的指针。
请问在c#中如何定义该结构体。
例如:
public class Tcl_Interp
{
const int RESULT_FULL_LEN = 0x200; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = RESULT_FULL_LEN)]
public string result;
//public IntPtr freeProc (string blockPtr);
int errorLine;
}
{
public string result;
public IntPtr freeProc(string blockPtr);
public int errorLine;
}
如果写成public IntPtr freeProc(string blockPtr);
那么我怎么才能控制函数的返回值是指向void *