c.***********@gmail.com said:
Is there any memory allocated in stack when declaring a functionPushing the three arguments on a stack is one way of implementing
e.g void fun(int a,int b,int c);
Is it true that compiler reserves 3 stack spaces for parameters a ,b
and c....
a function CALL (but not the only way).
As for function DECLARATIONS, I would say no. However, I can't
think of any reasons why a compiler COULDN'T pre-allocate some space
SOMEWHERE for AT LEAST ONE invocation of the function. Think about
why I said "AT LEAST ONE". What happens to the arguments in the
following cases?
fun() ---fun()
fun() ---scrotum() ---fun()
Yours,
Han from China