English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Okay trying to remember this from my C++ class.. but it been a while.. the "stack" is where all the variables that are declared and initialized before runtime are stored in the RAM right? and the "heap" is where all the variables created or initialized at runtime are stored in RAM.. I am probably so wrong, but uhm how close was I?

2006-08-06 17:46:20 · 3 answers · asked by retrogamer4ever 3 in Computers & Internet Programming & Design

3 answers

That sounds right. According to the dictionary:

heap (n)
1. An area of memory used for dynamic memory
allocation where blocks of memory are allocated and freed in
an arbitrary order and the pattern of allocation and size of
blocks is not known until run time. Typically, a program
has one heap which it may use for several different purposes.

and

stack (n):
Computer Science. A section of memory and its associated registers used for temporary storage of information in which the item most recently stored is the first to be retrieved.

Good luck!

2006-08-06 17:56:33 · answer #1 · answered by anonymous 7 · 0 0

I think stack is Pamela Anderson
and
heap is what she drove before she got famous.

2006-08-07 00:51:58 · answer #2 · answered by up.tobat 5 · 0 0

That sounds right to me, actually.

But I think uptobat deserves the 'best answer' for this one.

2006-08-07 00:54:38 · answer #3 · answered by JKP 2 · 0 0

fedest.com, questions and answers