cs246-s11-001-june16

cs246-s11-001-june16 - CS 246 (Spring 2011) Section 1...

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

View Full Document Right Arrow Icon
CS 246 (Spring 2011) – Section 1 Thursday 16 June Constructors, Destructors, and Copying
Background image of page 1

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

View Full DocumentRight Arrow Icon
CS 246 (Spring 2011) - Section 001 - Thursday 16 June 2 Today's Agenda Last class Constructors and Destructors Copying A3 questions
Background image of page 2
CS 246 (Spring 2011) - Section 001 - Thursday 16 June 3 Last class Let's have a look at the Job class from last day Terminology Class Object Member Routine member Operator member Constructor
Background image of page 3

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

View Full DocumentRight Arrow Icon
CS 246 (Spring 2011) - Section 001 - Thursday 16 June 4 More about constructors Constructors implicitly used for conversions Job x = 8; Job y = x + 4; Job z = y + 4.2; explicit : Disallow implicit conversions Problem with commutative binary operators Job u = 12 + z; Solution return os << “Terms:“ << j.numTerms; }
Background image of page 4
CS 246 (Spring 2011) - Section 001 - Thursday 16 June 5 2.18.4 Destructor A special member used when de-allocating space for a non-contiguous object
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 12/08/2011 for the course CS 246 taught by Professor Wormer during the Spring '08 term at Waterloo.

Page1 / 10

cs246-s11-001-june16 - CS 246 (Spring 2011) Section 1...

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