using System;
namespace QuickArray
{
internal class Program
{
private static unsafe void Main()
{
//Console.Write("How big an array do you want? \n> ");
//string userInput = Console.ReadLine();
//uint size = uint.Parse(userInput);
//sta
//long* pArray = stackalloc long[(int) size];
//for (int i = 0; i < size; i++)
//{
// pArray[i] = i*i;
//}
//for (int i = 0; i < size; i++
//{
// Console.WriteLine("Element {0} = {1}", i, *(pArray + i));
//}
int[]nums=new int[10];//注意数组是引用类型,所以在创建的时候,初始化
for (int i = 0; i < nums.Length; i++)
{
Console.WriteLine(nums[i]);//输出全部为0
}
int* p = stackalloc int[10];
for (int i = 0; i < 10; i++)
{
Console.WriteLine(p[i]);
}
Console.ReadLine();
}
}
}