top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How the memory is allocated to argument of function ?

+4 votes
359 views

Means, at the time of calling the function , local variable get memory first OR argument ?

posted Oct 23, 2013 by Anuj Yadav

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

2 Answers

+1 vote
answer Oct 23, 2013 by Vikas Upadhyay
+1 vote

As vikas pointed out call_stack is used for this purpose. Every process/program has a stack segment which creates an entry on every function call which contains the following in the given order
1. Arguments
2. Return Address
3. Local Variables

Source: Wiki

So obvious argument are created first...

answer Oct 23, 2013 by Sheetal Chauhan
...