lec03

lec03 - Pointers CS 2022 Introduction to C Instructor...

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

View Full Document Right Arrow Icon
Pointers CS 2022: Introduction to C Instructor: Hussam Abu-Libdeh Cornell University (based on slides by Saikat Guha) Fall 2009, Lecture 3 Pointers CS 2022, Fall 2009, Lecture 3
Background image of page 1

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

View Full DocumentRight Arrow Icon
Pointer Pointer A pointer is just another variable that points to another variable. A pointer contains the memory address of the variable it points to. int i; // Integer int *p; // Pointer to integer int **m; // Pointer to int pointer p = &i; // p now points to i printf("%p", p); // address of i (in p) m = &p; // m now points to p printf("%p", m); // address of p (in m) Pointers CS 2022, Fall 2009, Lecture 3
Background image of page 2
Pointers Pointers CS 2022, Fall 2009, Lecture 3
Background image of page 3

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

View Full DocumentRight Arrow Icon
Pointers Pointers CS 2022, Fall 2009, Lecture 3
Background image of page 4
Pointers Pointers CS 2022, Fall 2009, Lecture 3
Background image of page 5

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

View Full DocumentRight Arrow Icon
Pointers Pointers CS 2022, Fall 2009, Lecture 3
Background image of page 6
Pointers Pointers CS 2022, Fall 2009, Lecture 3
Background image of page 7

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

View Full DocumentRight Arrow Icon
Pointers Pointers CS 2022, Fall 2009, Lecture 3
Background image of page 8
Pointers Pointers CS 2022, Fall 2009, Lecture 3
Background image of page 9

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

View Full DocumentRight Arrow Icon
Pointers Pointers CS 2022, Fall 2009, Lecture 3
Background image of page 10
swap1.c: Swap #include <stdio.h>
Background image of page 11

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

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

This document was uploaded on 03/10/2011.

Page1 / 20

lec03 - Pointers CS 2022 Introduction to C Instructor...

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

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