Рет қаралды 1,179
Want to implement your own Cat type in C++? Or maybe some other type to represent your other favorite things? Or maybe always keep your data together in code? The answer is: classes and structs. We will be talking about these for a while, but we start here. In this video you'll learn the basics of what these words mean and how to use them to write better more readable #code.
As always, the script that goes along this video lives here: github.com/cpp-for-yourself/s...
#cplusplus #programming #cpp
00:00 - Intro
00:19 - An example game about a cat
01:27 - Example design using only functions
03:30 - Limitation of function-only approach
04:11 - Custom types to the rescue!
06:19 - Variables, objects, instances
06:50 - Naming rules
06:59 - What is encapsulation after all?
07:18 - Let's get slightly more formal
08:11 - public vs private
09:49 - What's with const after some class methods?
11:09 - Naming private data
11:58 - Oops, we forgot about struct!
12:53 - A short summary and outlook into the future videos