x
Almost there! Please complete this form and click the button below to gain instant access.
EliteFitness.com FREE Email Series: How You Can Use Winstrol, Masteron, HGH, and Testosterone for a Perfect, Muscular Physique!
- -
We hate SPAM and promise to keep your email address safe.
- -
puritysourcelabsdomestic-supply
napsgeargenezapharmateuticals
Sarms for Saleunclez.rueudomestic

Does Anyone Know Anything About Computer Programming


Welcome to the EliteFitness.com Bodybuilding Site! Please join this discussion about Does Anyone Know Anything About Computer Programming within the Chat & Conversation category.

Excerpt: MY NEPHEW ASKED ME THIS QUESTION HE IS VISITING. I DO NOT KNOW THE ANSWER AS I AM NOT A PROGRAMMER, I AM TOO STUPID :D HE WANTS TO KNOW THE DIFFERENCE BETWEEN "THE STACK" AND "THE HEAP" THANKS

Read more or register here to join the discussion below...

Results 1 to 4 of 4
  1. #1
    2 ton hoss
    Guest

    Does Anyone Know Anything About Computer Programming

    MY NEPHEW ASKED ME THIS QUESTION HE IS VISITING. I DO NOT KNOW THE ANSWER AS I AM NOT A PROGRAMMER, I AM TOO STUPID

    HE WANTS TO KNOW THE DIFFERENCE BETWEEN "THE STACK" AND "THE HEAP"

    THANKS

  2. #2
    Pro Bodybuilder huntmaster's Avatar
    Join Date
    Aug 2001
    Location
    Carpe Diem
    Posts
    1,454
    Rep Power
    0
    ooh Data Structures, I hated that class.

    Here are some vague definitions:

    A Heap is a tree where every node has a key that is more extreme (greater or less) than the key of its parent.


    Stack:
    A collection of items in which only the most recently added item may be removed. The latest added item is at the top. Data extraction method known as "last-in, first-out" or LIFO.

    anywho, I hope this helps. (I had to look this stuff up---seems that my hard disk is full and I am also running with too little ram. lol----)

    http://www.nist.gov/dads/

    Tell him to check the link above for additional definitions

  3. #3
    Good Broly
    Join Date
    Feb 2002
    Location
    Andor
    Posts
    157
    Rep Power
    0
    best I can remember is that the heap is used for when variables are allocated by the computer randomly. Example. you declare a variable and the computer accesses a part of the heap to store that variable. The stack is a block of space that is allocated by the computer and when a new variable of that type is declared, it only uses that block of space to store the specified variable. Maybe that helped some....its been about 3years since I had a class that dealt specifically with the heap/stack, but im 99% sure thats right

  4. #4
    Good Broly
    Join Date
    Jan 2002
    Posts
    151
    Rep Power
    0
    I think what he needs to know is how they are handled differently in an OS context. In the most simple terms, staticly allocated variables are stored on the stack, and dynamically allocated variables are stored on the heap.

    For instance, if I have a C program that has something like this:

    char foo = 'a';

    then the OS knows to allocated exactly one byte for the storage of variable "foo" at execution time. This allocation space will be the same every time the program is run, thus it is termed "staticaly allocated".

    If I have something like:

    if(rand(1) > .5)
    MyObj Bar = new Quux;

    then the storage for the variable "Bar" will be allocated on the heap, since there's no way the OS can know how much space will be needed. Half of the time, no extra space will be needed, and half of the time, sizeof(Quux) bytes will have to be allocated.

    Clear as mud?

Similar Threads

  1. Need computer programming help K for an answer
    By needtogetarmy in forum Chat & Conversation
    Replies: 10
    Last Post: 04-Sep-2008, 05:41 PM
  2. Replies: 31
    Last Post: 19-Apr-2007, 12:07 PM
  3. Programming to grow
    By Empire in forum Weight Training & Weight Lifting
    Replies: 0
    Last Post: 25-May-2004, 09:07 PM
  4. Web programming
    By macho21 in forum Chat & Conversation
    Replies: 3
    Last Post: 13-May-2004, 12:20 PM
  5. programming dorks will like this - my job
    By HappyScrappy in forum Chat & Conversation
    Replies: 17
    Last Post: 25-Jun-2002, 10:24 AM

Posting Permissions

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