Thread: function calls and return address

  1. #1
    Registered User
    Join Date
    Apr 2012
    Posts
    21

    function calls and return address

    Suppose function f calls function g, which in turn calls other functions. How does function g know where it should return to when its task is done?

    I know a stack space is created at every function call, but how control is returned to the program after a function call is still a mystery to me. if anyone could briefly explain this process thanks.

  2. #2
    [](){}(); manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    *nullptr
    Posts
    2,657

  3. #3
    Registered User
    Join Date
    Apr 2012
    Posts
    21
    thanks for that. i visited Stack (abstract data type) before but this page is much better.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Returning Address with Return Statement?
    By Waleed Mujeeb in forum C++ Programming
    Replies: 5
    Last Post: 03-23-2012, 05:47 AM
  2. how to return address of a pointer?
    By spotty in forum C Programming
    Replies: 1
    Last Post: 02-11-2010, 08:11 PM
  3. modifying a return address of a function
    By jay1313 in forum C Programming
    Replies: 3
    Last Post: 09-18-2008, 09:09 AM
  4. how to return the address of a member of a class
    By *DEAD* in forum C++ Programming
    Replies: 6
    Last Post: 07-13-2007, 09:15 AM
  5. Replies: 2
    Last Post: 12-07-2004, 02:31 AM