Lecture03

Lecture03 - CS2134 C++ Revisited Quick overview of Part I...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

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

Unformatted text preview: CS2134 C++ Revisited Quick overview of Part I of book (chapters 1 5) in two lectures Lectures will review some of the trickier concepts and introduce a few new concepts You should also read the book and/or your CS2114 notes to review the basics CS2134 Vectors and Strings Arrays are not first class objects cannot do the usual operations such as =, == STL provides vectors and strings class vector has indexing v (starts at 0; NO range checking) operator= size() resize() [Expensive] pushback() [doubles capacity if necessary] use call by reference or call by const reference to pass vectors as parameters CS2134 Pointers value of a pointer variable is address or NULL pointer declarations based on type of object the pointer references: C *p, *q //pointers to objects of class C operations: *p //dereference gives object at address p *p=*q // assignment of objects of class C p=q // assignment of pointers. Creates alias p = &x // where x is object of class C p->f // shorthand for (*p).f where f is member of C CS2134...
View Full Document

This note was uploaded on 12/09/2009 for the course CS 2134 taught by Professor Hellerstein during the Spring '07 term at NYU Poly.

Page1 / 9

Lecture03 - CS2134 C++ Revisited Quick overview of Part I...

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