1-5 - Problem Solving with Computers-II CS 24 January 5,...

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

View Full Document Right Arrow Icon
Problem Solving with Computers-II CS 24 January 5, 2010 Prof. Ambuj K. Singh Computer Science Biomolecular Science & Engineering
Background image of page 1

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

View Full DocumentRight Arrow Icon
Syllabus and other course information http://www.cs.ucsb.edu/~cs24
Background image of page 2
Course contents Refresher on pointers Software design principles Object oriented concepts Abstract Data Types Queues Stacks Lists Trees Graphs Recursion Running time analysis
Background image of page 3

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

View Full DocumentRight Arrow Icon
Lecture outline Discussion of pointers Software engineering principles Brief introduction to classes and ADT
Background image of page 4
5 Pointer Types ointer variable variable whose value is the address of a location in memory int* intPointer
Background image of page 5

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

View Full DocumentRight Arrow Icon
6 Pointer Types int alpha; int* intPointer; intPointer = α If alpha is at address 33, memory looks like this
Background image of page 6
7 Pointer Types int x; x = 12; int* ptr; ptr = &x; ptr Because ptr holds the address of x, we say that ptr “points to” x 12 2000 2000 x 3000
Background image of page 7

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

View Full DocumentRight Arrow Icon
8 Pointer Types Dereference operator (*) An operator that, when applied to a pointer variable, denotes the variable to which the pointer points Dynamic allocation (new operator) Allocation of memory space for a variable at run time (as opposed to static allocation at compile time)
Background image of page 8
Pointer Types int x; x = 12; int* ptr; ptr = &x; std::cout << *ptr; ptr Because ptr holds the address of x, we say that ptr “points to” x. *ptr
Background image of page 9

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

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

This note was uploaded on 05/20/2010 for the course CS 24 taught by Professor Singh during the Winter '10 term at UCSB.

Page1 / 32

1-5 - Problem Solving with Computers-II CS 24 January 5,...

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

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