C#中的string怎么转换成C++中的char?
如C++中:
unsigned char progid;
char cmd_id[10]; // 命令字,最大长度为9,以null结束上面这两个在C#中要怎么写呢,以null结束又要怎么写?
如C++中:
unsigned char progid;
char cmd_id[10]; // 命令字,最大长度为9,以null结束上面这两个在C#中要怎么写呢,以null结束又要怎么写?
unsigned char progid;
char cmd_id[10]; // 命令字,最大长度为9,以null结束
就是在这个结构体中定义的,而我需要在C#中也定义这样的结构体,然后把这个结构体发到C++的程序中.现在是不知道怎么在C#中定义这个结构体.
char cmd_id[10]; // 命令字,最大长度为9,以null结束C#
Byte progid;
System.StringBuilder cmd_id;这样试试。
public static extern void dllmethod([MarshalAs(UnmanagedType.LPStr,SizeConst=10
)]
String s);
}