EECS 280 Lecture Notes - Lecture 16: Stellar Classification, Function Overloading, Name Binding

102 views7 pages

Document Summary

When driver runs, looks for members in derived class, if not found then goes to base class. Ability of one code to take on many forms depending on how it"s used. Different polymorphism: subtype polymorphism (this is the one they mean when people refer to plmphms), ad-hoc polymorphism (function overloading). Function overloading: several functions in one scope with the same name but different signatures (signature includes name and parameter types, but. Object slicing, this leads to potentially losing a lot of important info/data). Bird b = c; //problem because chicken is larger data than bird. Solution: we use pointers or references to work with objects indirectly! a bird* and a chicken* take the same amount of space because they are both addresses! //bird is one type, that is pointing to a different type chicken. Static vs dynamic type static type: of a pointer/ref is the type it is declared with and known at compile time.

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