Practical C 600.111
Lecture 3 Outline
Additional Reference Material
Programs and Memory
Heap vs. Stack
Dynamic Memory Management
Malloc
Calloc
Free
Realloc
Memory: memcpy
Memory: memset
Common Memory Allocation Problems
Slide 14
Slide 15
How to Debug Memory Problems
Dmalloc Library
Using Dmalloc
Assertions
Assertions - Example
Passing Arguments to Functions
Slide 22
Command-line Parameters
Command-line Parameters (contd.)
Command-line Parameters - Example
Varying-length Argument List
Slide 27
Varying-length Arg. List - Example
Slide 29
Exercise
Homework 2
Author: Cristina Nita-Rotaru
E-mail: crisn@cs.jhu.edu
Homepage: http://www.cs.jhu.edu/~crisn
Best viewed with