关于c#和c++类型的问题
c++函数原形为
getUserInfomation( char* a, char* b, char* c )
他要求传入3个char*作为参数
我在c#中调c++函数,参数这样传,不知道对不对
string strA = "abc ";
string strB = "bcd ";
string strC = "cde ";
char[] charAryA = new char[24];
charAryA = strA.ToCharArray();
char[] charAryB = new char[24];
charAryB = strB.ToCharArray();
char[] charAryC = new char[24];
charAryC = strC.ToCharArray();
fixed( char* chrA = charAryA, chrB = charAryB, chrC = charAryC ){
getUserInfomation( chrA, chrB, chrC);
}
请各位路过的大虾指点,谢谢
------解决方案--------------------一般情况下,char*在c#里用string、StringBuilder、byte*或者byte[]