Thread: The stack.

  1. #1
    Registered User
    Join Date
    May 2010
    Posts
    62

    The stack.

    Does anyone have a link to a website where the stack is explained in kinda a childish way so it is easy to understand or a more advanced explanation in Dutch?

  2. #2
    Registered User
    Join Date
    Aug 2003
    Posts
    1,218
    Since you didnt specify if you wanted to know more about the stack datastructure or the hardware stack ill point you to wikipedia:
    http://en.wikipedia.org/wiki/Stack_(data_structure)

  3. #3
    Make Fortran great again
    Join Date
    Sep 2009
    Posts
    1,413
    Get an HP calculator

  4. #4
    Registered User
    Join Date
    May 2010
    Posts
    62
    This but then simplified.

    Understanding the Stack

  5. #5
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    The only thing you have to understand about the stack right now for learning C++ is this: The memory for a program is broken into two parts, the heap and the stack. The heap contains global and dynamically allocated (with new or malloc) data. The stack contains the data for currently executing functions, growing upward for each function called. When a function ends, it's data is removed from the stack, and the function which called it is now on top.

    So you start with the data local to main on the stack. If you then call function foo(), foo goes onto the top of the stack. If bar() is called from foo(), bar then goes on to the stack. When bar() is finished, it is removed from the stack and control returns to foo(). When foo() is finished it comes off the stack and control returns to main().

    Beyond that, don't worry about it too much.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  6. #6
    Just a pushpin. bernt's Avatar
    Join Date
    May 2009
    Posts
    426
    Does anyone have a link to a website where the stack is explained in kinda a childish way so it is easy to understand
    Simple English Wikipedia is wonderful.
    Stack (data structure) - Simple English Wikipedia, the free encyclopedia

    or a more advanced explanation in Dutch?
    Or the dutch translation of wikipedia. That works too.
    Stack (informatica) - Wikipedia

    This but then simplified.

    Understanding the Stack
    Or Google translate.
    http://translate.google.com/translat...s%2Fstack.html
    Last edited by bernt; 05-19-2010 at 09:36 PM.
    Consider this post signed

  7. #7
    Registered User
    Join Date
    Oct 2008
    Posts
    1,262
    Quote Originally Posted by bernt View Post
    Or Google translate.
    Google Translate
    Well, let me translate the first two sentences back to English from that.

    Meeting languages offer support to give food to sentences conditionally. If you add, and jump / tree branch (the assemblage of "goto" reports), then you can oustrous cycle [that is, the period nonhuman mammals are sexually aroused].
    Well, no, that makes sense.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. stack and pointer problem
    By ramaadhitia in forum C Programming
    Replies: 2
    Last Post: 09-11-2006, 11:41 PM
  2. infix evaluation using stack
    By lewissi in forum C++ Programming
    Replies: 0
    Last Post: 11-03-2005, 02:56 AM
  3. Question about a stack using array of pointers
    By Ricochet in forum C++ Programming
    Replies: 6
    Last Post: 11-17-2003, 10:12 PM
  4. error trying to compile stack program
    By KristTlove in forum C++ Programming
    Replies: 2
    Last Post: 11-03-2003, 06:27 PM
  5. Stack Program Here
    By Troll_King in forum C Programming
    Replies: 7
    Last Post: 10-15-2001, 05:36 PM