110,539
社区成员
发帖
与我相关
我的任务
分享
[DllImport("KERNEL32.DLL", CharSet = CharSet.Auto, EntryPoint = "GetSystemTimeAdjustment")]
extern static int GetSystemTimeAdjustment(ref long adjustment, ref long clockInterval, ref bool adjustmentDisabled); //单位是100ns
using System;
class UnsafeTest
{
// Unsafe method: takes pointer to int:
unsafe static void SquarePtrParam(int* p)
{
*p *= *p;
}
unsafe static void Main()
{
int i = 5;
// Unsafe method: uses address-of operator (&):
SquarePtrParam(&i);
Console.WriteLine(i);
}
}