SoFunction
Updated on 2025-03-06

C# stack change rules diagram example (stack growth and death)


using System;
using ;
using ;
using ;
using ;

namespace StackAndHeapStudy
{
    unsafe class Program
    {
        static void Main(string[] args)
        {
            var test = new TestClass();
            SetX(test);
            (*);
            (*);
        }

        private static void SetX(TestClass test)
        {
            var X = 10;

            = &X;
        }
    }

    unsafe class TestClass
    {
        public int* X;
    }
}