Presentation is loading. Please wait.

Presentation is loading. Please wait.

CSC 253 Lecture 8.

Similar presentations


Presentation on theme: "CSC 253 Lecture 8."— Presentation transcript:

1 CSC 253 Lecture 8

2 What regions can hold our data?
A. Stack, static, and extern B. Stack, heap, and static C. Stack and heap D. Local and static E. Local, static and extern

3 Why do we need heap storage?
A. To make sure we don’t run out of memory. B. To allow variables to outlast procedure calls & returns. C. To give us a place to allocate arrays D. Both A and C.

4 Pointers to variables on the stack
Declare a non-pointer variable. Declare a pointer variable. Set the pointer to point to the non-pointer.

5 Pointers to variables on the heap

6 What happens if we increment a pointer?

7 Incrementing pointer vs. incrementing value pointed to

8 Let’s make our printing code into a procedure
What parameters would we pass? What type is the first parameter? What type is the second parameter? int int* int & char

9 Why use handles?


Download ppt "CSC 253 Lecture 8."

Similar presentations


Ads by Google