Week 2 - Pointers Flashcards

1
Q

What does malloc do?

A

Allocates the requested number of bytes in memory and returns a pointer that points to the start of allocated memory.

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

What does free() do?

A

Takes a pointer as an argument. Deallocates the memory location the pointer points to.

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