The Chernotes #2
Your handy study guide and review sheet
CLASSES AND STRUCTS
Object oriented programming is a style you can adopt. Some languages like ____ and _____ are meant to be object oriented.
____ doesn't have classes, but it was added in C++.
Why don't we just make loose variables in our code to represent a player?
Syntax: What do we need after the closing curly brace when defining a type?
A variable made from a class type is called an ______.
Creating a new ______ of a class it is called instantiation.
Why can't we access "x" directly via the dot operator?
How is the default access level for a class different in C++ relative to Java?
Moving the Player
Cherno writes a move function. It goes pretty quick - pause it and make sure you understand this. Why pass by reference?
How do you move the function into the player class?
What is the difference?
What is the default visibility of a class?
What is the default visibility of a struct?
Are there any other differences between the two?
Why do structs exist in C++?
The difference comes down to ______.
Cherno's Style Guide
When does he use structs?
Will Cherno use inheritance with structs? Why or why not?
Note: Cherno's guide is a pretty good set of guidelines. There's no absolute rule in industry on this, but what he's suggesting is pretty conventional.
Why is he writing a logging system as an example class?
What are his goals / features he plans to write for the log class?
Follow his example
What is the purpose of the m_ convention?
Why does he have public written twice?
How does the log level system work?
CONSTRUCTORS AND DESTRUCTORS