Lecture 16 - Lecture 16 Oct 30, 02 Recap Lec 15 We have a...

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

View Full Document Right Arrow Icon
Lecture 16 Oct 30, 02
Background image of page 1

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

View Full DocumentRight Arrow Icon
Recap Lec 15 We have a class. Class contains data and functions Access specifiers - private and public Objects are created from a class. Class forms the blueprint for objects to be created with data members and functions
Background image of page 2
3 sections of C++ program 1. Class declaration 2. Class implementation 3. main() function (We also discussed about the constructor function)
Background image of page 3

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

View Full DocumentRight Arrow Icon
Class implementation Date::Date(int mm, int dd, int yyyy) // constructor function date { month = mm; day = dd; year = yyyy; } void Date::setdate(int mm, int dd, int yyyy) // function setdate { month = mm; day = dd; year = yyyy; return; } void Date::showdate(void) // function showdate { cout<<month<<day<<year<<endl; return }
Background image of page 4
Class implementation explanation The member functions declared in declaration section are written. :: (scope resolution operator identifies the function as a member of a particular class). The class has 3 functions
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.

Page1 / 9

Lecture 16 - Lecture 16 Oct 30, 02 Recap Lec 15 We have a...

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