MAT 21B Lecture 21: Lecture 21

22 views2 pages
School
Department
Course
Professor
Lecture 21
Dynamic memory allocation
Free()
- Void free()
o Provided by header stdlib.h
o Frees allocate area pointer by ptr
Calloc()
- Malloc() only allocates certain number of bytes
- Calloc() allocates certain number of item
3 phase schemes
- Allocation of data
- Computation involving data
- Free data
Realloc()
- Increase and decrease size of space pointed by prt
-
- Useful approach for dynamic arrays
See powerpoint for 1D array, 2D array and string
Below is from powerpoint reference:
Unlock document

This preview shows half of the first page of the document.
Unlock all 2 pages and 3 million more documents.

Already have an account? Log in
beigecamel74 and 41 others unlocked
MAT 21B Full Course Notes
83
MAT 21B Full Course Notes
Verified Note
83 documents

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents