CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2005
    Posts
    336

    Where is stack frame

    Hi
    I am reading documents about stack frame. But i really confused about where the stack frame of func. is.
    For example here
    http://courses.ece.uiuc.edu/ece390/l...ckwood/l8.html
    It doesnt include local variables to stack frame
    But here
    http://en.wikipedia.org/wiki/Call_stack
    it includes.

    So can anyone explain me which one is true?
    What is the procedure for function call in c?

    I am looking for your answers

    Thanks.

  2. #2
    Join Date
    Aug 1999
    Location
    <Classified>
    Posts
    6,882

    Re: Where is stack frame

    Both are right, the first link talks in context of assembly language, which is little raw, but the wiki article is better to understand.

    In C/C++, first the arguments are pushed, return address and then EBP. Once the function enters, it creates it's local variables on stack, thus moving the stack pointer further by size of it's variables.

    Take a look at following article,

    Playing with stack
    Regards,
    Ramkrishna Pawar

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured