lec0126-ptrsetc - Todays announcements: Course policies:

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

View Full Document Right Arrow Icon
Today’s announcements: Course policies: http://www.cs.illinois.edu/class/cs225 Email assistance (ews, svn): cs225help@cs.illinois.edu Sections meet in Siebel 0224, NOT Siebel ARR. MP2 available, due 2/8, 11:59p. EC due 2/1, 11:59p. Proficiency exam: 1/31, 7-10p, Siebel 2407
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 variables and dynamic memory allocation: Stack memory loc name type value Heap memory Youtube: pointer binky c++ loc name type value a40 p int * int * p;
Background image of page 2
Fun and games with pointers: (warm-up) int * p, q; What type is q?______________ int *p; int x; p = &x; *p = 6; cout << x; What is output?______________ cout << p; What is output?______________ Write a statement whose output is the value of x , using variable p : ___________
Background image of page 3

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

View Full DocumentRight Arrow Icon
Fun and games with pointers: int *p, *q; p = new int; q = p; *q = 8; cout << *p; What is output?______________ q = new int; *q = 9; p = NULL; Do you like this?_____________ delete q; q = NULL; Do you like this?_____________ Memory leak:
Background image of page 4
Fun and games with pointers: int * p, * q; p = new int; q = p; delete p; … // some random stuff cout << *q; Do you like this?_____________
Background image of page 5

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

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

This note was uploaded on 01/26/2012 for the course CS CS 225 taught by Professor Heeren during the Spring '09 term at University of Illinois, Urbana Champaign.

Page1 / 12

lec0126-ptrsetc - Todays announcements: Course policies:

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

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