Download presentation
Presentation is loading. Please wait.
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
(See 2.c)
6
What happens if we increment a pointer?
(also in 2.c)
7
Incrementing pointer vs. incrementing value pointed to
(also in 2.c)
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 (See 3.c)
9
Why use handles?
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.