我的代码:
string str1 = "link";
byte[] buf = System.Text.Encoding.Default.GetBytes(str1);
IntPtr f = Marshal.AllocHGlobal(buf.Length);
Marshal.Copy(buf, 0, f, buf.Length);执行后在buf为"link··オ·",在字符串后多了“··オ·”,什么原因啊?我现在是c#生成dll,c++代码调用。请高手帮忙看下
string str1 = "link";
byte[] buf = System.Text.Encoding.Default.GetBytes(str1);
IntPtr f = Marshal.AllocHGlobal(buf.Length);
Marshal.Copy(buf, 0, f, buf.Length);执行后在buf为"link··オ·",在字符串后多了“··オ·”,什么原因啊?我现在是c#生成dll,c++代码调用。请高手帮忙看下
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货