lect07 - CMSC 216 Introduction to Computer Systems Lecture...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
CMSC 216 Introduction to Computer Systems Lecture 7 Pointers Jan Plane & Pete Keleher {jplane, pete}@cs.umd.edu Administrivia • Project 1 – grades will be available on grades server soon • Project 2 posted • Exam #1 – Thursday, October 6 in Lecture • Read Reek, Chapter 6: Pointers 2
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
P OINTERS Chapter 6, Reek 3 Garbage pointers • When a pointer is declared, it points to whatever address was in the memory location allocated for the pointer (no initialization) • Trying to dereference this random address will generally result in one of three Bad Things: – accessing a memory location you don't have permission to access (a "segmentation fault") – violating the computer's alignment policies (a "bus error") – silent failure: everything appears to work right. .. for now 4
Background image of page 2
NULL pointer This is a pointer that points to the address 0, where nothing is allowed to be accessed Defined in stddef.h , which is included by many other header files Analogue to Java's null – What happens when you try to call a method of an object which
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 9

lect07 - CMSC 216 Introduction to Computer Systems Lecture...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online