using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace polealazasobnik
{
class Test
{
unsafe static void Main()
{
const int arraySize = 20;
int* fib = stackalloc int[arraySize];
int* p = fib;
// The sequence begins with 1, 1.
*p++ = *p++ = 1;
for (int i = 2; i < arraySize; ++i, ++p)
{
// Sum the previous two numbers.
*p = p[-1] + p[-2];
}
for (int i = 0; i < arraySize; ++i)
{
Console.WriteLine(fib[i]);
}
// Keep the console window open in debug mode.
System.Console.WriteLine("Press any key to exit.");
System.Console.ReadKey();
}
}
}
tento kod mi vypise chybu
Error 1 Unsafe code may only appear if compiling with /unsafe C:\Users\Pepek\AppData\Local\Temporary Projects\polealazasobnik\Program.cs 10 29 polealazasobnik
prosim poradte