Hi
I don't understand few things about how c program allocates memmory for variables
Program allocates memmory for local variable at the point where variable is defined(given a value)and when program exit's variable's scope,memmory is released.
1-But,does program at the start of execution already know that some local variable is going to need particular memmory size,but allocates space for it only at point where variable is given a value?Or has program,at the start of execution,no idea how much space variable is gonna need?
2-After program execution exit's the local variable's scope,memmory is released.Could that exact memmory space be used in the same program for another local variable?
thank you
I don't understand few things about how c program allocates memmory for variables
Program allocates memmory for local variable at the point where variable is defined(given a value)and when program exit's variable's scope,memmory is released.
1-But,does program at the start of execution already know that some local variable is going to need particular memmory size,but allocates space for it only at point where variable is given a value?Or has program,at the start of execution,no idea how much space variable is gonna need?
2-After program execution exit's the local variable's scope,memmory is released.Could that exact memmory space be used in the same program for another local variable?
thank you