- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
using System;
unsafe struct A
{
static uint tmp;
static int * [] vars;
static void Main()
{
int a = 10, b = 5;
uint[] data = Swap((uint)&a, (uint)&b);
vars = new int * [data.Length];
for (int i = 0; i < data.Length; i++)
{
vars[i] = (int*)data[i];
};
}
static uint[] Swap(uint a, uint b)
{
tmp = a;
a = b;
b = tmp;
return new uint[] { a, b };
}
};