C#初级问题(int并不包含对formate的定义)
using System;class Text
{
unsafe static void WriteLocations(byte[] arr)
{fixed(byte *p_arr=arr)
{byte *p_elem=p_arr;
for(int i=0;i<arr.Length;i++)
{byte value=*p_elem;
string addr=int.Format((int) p_elem,"X");
Console.WriteLine("arr[{0}] at 0x{1} is {2}",i,addr,value);
p_elem++;
}
}
}
static void Main()
{byte[] arr=new byte [] {1,2,3,4,5};
WriteLocations(arr);
}
}
编译时出现错误:CS0117:int并不包含对formate的定义