Deadlines/Announcements

😫 Project 5 due 9PM Sunday, March 6th

😳  Final Exam online

πŸ€‘Β  Optional quiz as mentioned in class.

β€”

this week’s slides: bit.ly/cs31w22_week9

last week’s slides: bit.ly/cs31w22_week8

home page: bit.ly/cs31w22

credit: nikki woo+zhehui+rosemary

Today's Agenda

Quick Note

// vs. structs: <https://www.geeksforgeeks.org/structure-vs-class-in-cpp/>
// they are the same besides their default visibility
// struct: default public
// class: default private

// can copy and paste code from prior notes and replace "struct" with "class" 
// and get same behaviour!

// all data members private

Header Guards

In header files, it’s quite easy to end up in a situation where a definition in a header file gets included more than once. This can happen when a header file #includes another header file (which is common).