1 year ago
#374689
AlwaysLearning
Question about stack and local variables when calling methods
I'm learning C# from the book Head First C# and the following screenshot is taken from page 605. It's showing here what the stack looks like when calling methods.
As I understand from the book, when you call a method, its local variables will be stored on the stack temporarily until the method returns. Given the example in the book, I don't understand the following:
- Why isn't
MealSize
added to the stack beforeCapacity
? - Why are there 2
Bowl dogBowl
on the stack? Shouldn't they be the same argument being passed?
Thank you so much for your help!!
c#
arguments
stack
0 Answers
Your Answer