If you are intended to get the address of the variable,you may have to resort to unsafe code://csc /unsafe GetAddress.cs using System;class GetAddress{ unsafe static void Main(){ int i = 10; Console.WriteLine("The address of {0} is:{1}",i,((int)&i).ToString("X")); } }
using System;class GetAddress{
unsafe static void Main(){
int i = 10;
Console.WriteLine("The address of {0} is:{1}",i,((int)&i).ToString("X"));
}
}
a.ToString()
}不行吗?
{
这里面可以使用*i,&i
}