The Heap and More Flashcards

1
Q

Is the heap outside the call stack?

A

yes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How is memory assigned to the heap?

A

By the operating system

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How can a function access memory from the heap?

A

Using a pointer to it

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

From C’s perspective, a 1-d array is just a :

A

pointer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How do we get memory from the heap in C?

A

Alternative to malloc: calloc

Conceptually creates an array of values and sets the memory to be 0.
Format: void *calloc (int array_size, int size_of_one_array_entry)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Does space in the heap change dynamically?

A

No, you must change the size as you need to.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly