COM SCI 31 Lecture Notes - Lecture 9: Unary Operation, Operator Overloading

35 views4 pages
25 Mar 2017
School
Professor

Document Summary

Main use: reusability: one function that is executed multiple times. Common specificities in the parent class (car: specificities that are different in the child class (honda or bmw or etc. ) // z will still be copied but cannot be accessed to children classes class a class b : public a. // x = public, y = protected; z = not accessible from b. Syntax = class childclass : parentclass (and how you can inherit the parent class (public/protected/private): specifies the access specification. // x = protected, y = protected, z = not accessible from c. }; // person = parent or base class class student: public person public: string uni; // student will get name and age too from person friend class. Gives another class access to private members in a class private: int width, height; pu(cid:271)li(cid:272): class rectangle { class square {

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents