
This lecture introduces you to the entire course. This is where you get to find out what the course is all about, how it's structured and what it actually covers.
What is this beast we call C++? Why is it worth learning C++ as opposed to C#, Java or <insert fancy language here>?
Let's talk about the industries that use C++ most, and why they are using it.
What's so great about C++?
C++ has plenty of issues, and it pays to be aware of them in advance.
This lecture discusses the new term Modern C++ which refers, roughly, to the C++11 and later standards of the language.
The tool that turns your code into an actual program is called a compiler, and there are lots of C++ compilers out there.
Making an application is not easy, which is why build systems exist - they help us put together all the necessary parts to produce the final product. Build systems can be local or distributed (i.e., use more than one computer).
If you want to use code that someone else has written, or share your code to be reused, you will be working with libraries. There are two types of libraries - static and dynamic.
Integrated Development Environments (IDEs) make life a lot easier.
What is source code, exactly?
The preprocessor is a nasty, archaic part of the compilation process. But, for now, there's no way of avoiding it.
Finally, the process of turning source code into something useful... object files!
Once you have all your object files, you can link them together to produce an executable or a library.
A bonus video on using Cling for scripting... if you are starting with C++, you totally must get yourself Cling. It's just that good.
We discuss the notion of a type system, what it means to work with a statically typed language, and the difference between built-in and user-defined types.
Variables store data. Simple as that.
These data types store whole numbers, like -42 or 1 million. But there are lots of them, they can be signed or unsigned, and C++ has plenty of issues with representing integral types consistently.
Different symbols such as + or / that can operate on numbers.
Finally, non-whole numbers! And things are a little simpler here than with integers.
What happens when you add an int and a float? There are rules for this!
The auto keyword saves a lot of effort. And now is as good a time as any to become familiar with it.
A few words about where you can find common mathematical operations, complex number support, and a word about the different math libraries that are out there.
We take a look at logical (boolean) types and the two special values `true` and `false`.
We look at how to compare values using operators such as `<`, `!=` and others.
We look at how conditions can be grouped using `&&` (AND), `||` (OR) and other operators.
What is a scope and why should you care?
A look at how to execute code conditionally with the `if-then-else` construct. Also we discuss the ternary `?:` operator that can offer a shorter alternative.
The `switch` makes it easier to check a value against several discrete cases. The `break` lets you jump out of various control flow constructs.
The `while` loop lets you execute the associated code block while a condition holds.
The most versatile loop of them all.
We discuss some of the memory areas that are used by a typical C++ program.
We discuss the Stack, which is an area of memory for statically allocated objects of known size.
We discuss the Heap, an area of memory used for dynamic allocation.
Pointers are variables which store memory addresses, i.e., point to other variables.
References refer to other variables. Their syntax is different (and arguably simpler) than that of pointers.
Arrays are nice and useful.
A discussion of how to go through all the elements in the array.
How to make 2D arrays on the stack on the heap. Extensible to arrays of any dimension.
A more user-friendly array class from the Standard Library.
An extensible array type that you should be using for just about every situation where a collection of same-type elements needs to be stored.
We look at how to store textual information in C++.
Standard Library comes to the rescue with a string type we can actually use.
A look at some useful things you can do with an std::string.
Another badly defined piece of the C++ text handling puzzle. Nothing to do with Unicode.
What are functions and why do we need them?
A note on function return types. What if a function doesn't return anything?
The function that gets called first in every executable.
How to get a pointer to a function?
The pinnacle of human achievment: lambda functions.
Learn how to make neat aliases for existing types.
Learn how to represent categorical variables using enumerations.
A single area of memory can be treated simultaneously as different data types. This is what unions are for.
Finally, a custom data type with members!
A note that UDTs can contain other UDTs ad infinitum.
We've met member variables (a.k.a. fields) before, but what are member functions?
A class is almost the same as a struct. No, really!
A constructor is a member function that gets called when the class is, err, constructed.
Called when the class is destroyed, this is the exact opposite of a constructor.
The ability to automagically acquire another class' fields and functions. No pillaging required.
An ability to inherit from several classes! You don't get this in C# or Java!
A way for classes to hide their members from the outside world.
A Polymorph spell turns a human into a frog. In C++, polymorphism lets derived classes be treated as their parents.
A useful operator for figuring out if an object is of a particular type.
This course will teach you the fundamentals of the C++ programming language, with a focus on Modern C++ features and the efficient use of tools. Start with the fundamentals and work your way up to advanced C++11 concepts and OOP mastery!
This course is presented as a combination of slide-based theory material and screencasts showing the IDE and the author writing programs and running them in the terminal.
Here are some of the things we are going to cover in the course:
C++ ecosystem: compilers, Integrated Development Environments (IDEs) and other tools
The compilation process (how C++ source files are compiled and linked)
Data types: numeric (integers, floating-point), strings, arrays, vectors, etc.
Control flow constructs (if, switch, while, etc.)
Memory management (stack and heap allocation, deletion, smart pointers)
User-defined types (how to define your own classes and class members)
Object-oriented programming (polymorphism, inheritance, encapsulation)
Why take this course? Glad you asked. This course is...
Fast-paced, yet feature-complete — covers all core feature of the language
Covers only modern C++ (C++11, 14, 17 and 20)... there is very little 'legacy' C/C++ covered in the course!
Opinionated towards best practices using latest versions of the language
Additional content – driven by you!
That last part means that additional lectures will appear driven by your comments and requests. I read all feedback and comments and try to provide feedback as quickly as possible.
Enjoy!