Lecture8 - Outline CS11600: Introduction to Computer...

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

View Full Document Right Arrow Icon
1 CS11600: Introduction to Computer Programming (C++) Lecture 8 Svetlozar Nestorov University of Chicago 1/22/2003 Svetlozar Nestorov, CS 116: Intro to Programming II 2 Outline ± Classes, objects, instances ± Different kinds of constructors ± Const objects ± Const data member ± Const member functions ± Enumerated types ± Examples 1/22/2003 Svetlozar Nestorov, CS 116: Intro to Programming II 3 Class Terminology ± Class is a data type. ± An objects is an instance of a class. ± Class interface is the outside view of class instances. ± Class consists of all public members (data and functions). 1/22/2003 Svetlozar Nestorov, CS 116: Intro to Programming II 4 Constructors ± A class may have several constructors. • Constructors must have different signatures (list of arguments). ± Default constructor • Either no arguments or all arguments have default values but not both ± Copy constructor • Used when objects are initialized 1/22/2003 Svetlozar Nestorov, CS 116: Intro to Programming II 5 Example class Beer { char *name;
Background image of page 1

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

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

Page1 / 2

Lecture8 - Outline CS11600: Introduction to Computer...

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

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