日期:2014-05-18  浏览次数:20948 次

c# unsafe中fixed的用法
在C#中,要使用*,所以用了unsafe的方法,但是fixed每次只能给一个指针赋值吗?如下
  sbyte[]   sbArrayFilePath   =   (sbyte[])((Array)System.Text.Encoding.Default.GetBytes(str));
  sbyte[]   sbArrayPaperId   =   (sbyte[])((Array)System.Text.Encoding.Default.GetBytes(paperId));
  fixed   (sbyte*   sb   =   sbArrayFilePath)
  {
  }
有没有这种用法
fixed   (sbyte*   sb   =   sbArrayFilePath   &&sbyte*   sb1   =   sbArrayPaperId   )
就是想每次执行多个指针的赋值,
有没有像上面类似的用法?


------解决方案--------------------
C# code
fixed (sbyte* sb = sbArrayFilePath, sb1 = sbArrayPaperId)