{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

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

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

Problem Solving with Computers-II CS 24 January 5, 2010 Prof. Ambuj K. Singh Computer Science Biomolecular Science & Engineering

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

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

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

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

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

View Full Document
6 Pointer Types int alpha; int* intPointer; intPointer = α If alpha is at address 33, memory looks like this
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

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

View Full Document
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)
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

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

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
Ask a homework question - tutors are online