I have been trying to learn about the memory management in C# and it is a very interesting topic. I made one simple code which is as follows:
using System; public class MyClass { public void Go() { int x = 5; AddFive(x); } public int AddFive(int pValue) { pValue += 5; Console.WriteLine(pValue); return pValue; } public static void Main(String[] args) { MyClass mc1 = new MyClass(); mc1.Go(); Console.ReadLine(); } }
I was reading an article from this website about the memory management by Matthew Cochran and it had the following statements:
When we make a method call here's what happens:
Please explain me all the three points(especially the first and the third point) in a very simple way. I am a beginner and i want to know what happens when we execute a method..... Thanks in advance!!!