I've got a quite small and straight forward question, I'll would like to get a sure answer for, and thank you guys in advance:
Inside a method ( say the main for instance ), I can add curly braces {} for any section of the code to scope some lines as locals.
Here's my example:
public static void Main (string[] args)
{
int a = 1;
{ int b = 2;
Console.WriteLine(b);
}
Console.WriteLine(a);
}
The variable "int b" is obviously non-accessible in the out side of the curly braces, now my question is about this variable's memory position, is it going to be in the same stack frame with the main method in the same stack of memory, or it's going to be held in yet a newer stack frame on top of the main method's stack (like called method's parameters and local variables inside another method)?