Hi, my name is Mateo, and welcome to the course
about pointers and arrays in C++ 20.
This course is made for, kind of, intermediate C++ programmers that
already know the basics of the language, but didn't yet get to the
wonders of memory management and pointers.
So first, let's talk about prerequisites. Before you begin the course,
I will assume that you are already familiar with the basics
of the C++ language. You know the syntax,
you know how to compile and run C++ code, and you're familiar with the
essential language building blocks like decision‑making structures,
loops,
functions, and a little bit of object‑oriented
programming for creating user‑defined types.
If you are not on good terms with any one of these,
I would advise you to check out other Pluralsight
courses which cover these topics.
I will be using Visual Studio Code as my code editor and GNU C++
compiler inside of the integrated terminal. You can, of course, use
your preferred IDE compiler and operating system. As long as you can
write and compile the code, all of the examples from the course should
work on your computer too.
Just one important note. Since this is a C++ 20 course,
I will be adding the c++20 standard option to the compiler command, so
make sure that you set this new standard too in your IDE or whatever
development environment you use. Most of the code from the course will
work with older standards too,
but we should still aim to keep up with the updates of the modern C++ language.
A lot of C++ programmers would advise you to avoid using raw
pointers altogether in modern C++ development, and they're right.
You should avoid them in most situations.
So then why would you even watch this course?
Well, there are two main reasons.
First one is the most obvious, legacy.
There are a lot of legacy C++ codebases in existence
which are still used to this day.
Just because standards changed,
that doesn't mean that they all got rewritten. Add that to the
fact that C++ used to be considered as just a superset of the C
language which heavily relies on use of concepts like pointers
for manipulating memory.
So when you see these raw pointers and raw arrays in all their code,
you should at least know what they are and how to use them to your advantage.
The other and, in my opinion,
more important reason for watching this course is the
familiarity with the underlying concepts that build the
modern C++ language we know and love today.
Modern C++ considers raw pointers dangerous, so it uses
abstractions like smart pointers to help developers in
avoiding mistakes and memory leaks.
However,
that doesn't mean that you should not learn about how pointers work and
how they relate to arrays and user‑defined objects.
In my opinion,
this knowledge is essential if you want to be a good C++ programmer because
all of these abstractions, smart pointers, references,
standard library arrays, and vectors, are all just wrappers
around raw pointers with added functionality,
usually a templated class.
I just wanted to assure you that what you learn here will pay off
its dividends in the long run because being a C++ programmer
means that you care about efficiency,
optimization, and lower‑level access to memory.
If you understand how pointers work,
you will see why there was a need to create additional
abstractions on top of them and how to utilize these
abstractions to make your programs more efficient.
But let's go step by step and first learn what pointers are and why
we need them in the first place. You can download all of the source
code examples and presentation slides from the course by downloading
so‑called exercise files.
Welcome to the course, and if you have any questions,
please ask them in the Discussion section of the courses page.
So, let's get to it.