Working with Pointers and Arrays in C++ 20
Managing memory with pointers on a low level is one of the key building blocks of modern C++. This course will teach you how to use pointers and how they relate to arrays and dynamic memory management.
What you'll learn
C++ offers us high-level abstractions as a modern OOP language, but it also allows us to dig into the low-level memory management if needed. In this course, Working with Pointers and Arrays in C++ 20, you’ll learn to use pointers to indirectly access data from memory. First, you’ll explore what pointers are and how referencing works. Next, you’ll discover how this knowledge can be used for dynamic memory allocation and how pointers and arrays are related. Finally, you’ll learn how to use these skills to implement them in the modern C++ OOP environment. When you’re finished with this course, you’ll have the skills and knowledge of using indirection needed to work with pointers and arrays in C++20.
Table of contents
- Course Introduction and Prerequisites 4m
- Referencing Variables from Memory 3m
- Using Pointers to Store Memory Addresses 7m
- Dereferencing Pointers 4m
- Introducing Scope and RAII 6m
- Passing Arguments by Reference 8m
- Using References Instead of Pointers 5m
- Const with Pointers and References 4m
- Summary 3m
- What Is the Point of Arrays? 3m
- Using Pointer Arithmetic to Access Array Elements 6m
- Working with Raw Arrays 8m
- Arrays Decay to Pointers 6m
- Pointing to Functions 7m
- Allocating Dynamic Arrays on the Heap 5m
- Multidimensional Arrays on the Stack 7m
- Constructing Dynamic Multidimensional Arrays 7m
- Pointing to an Array 5m
- Comparing Strings with Arrays of Characters 6m
- Summary 5m
- Accessing Class Members with the Arrow Operator 3m
- Using Base Class Pointers as an Interface 10m
- Virtual Tables and Virtual Pointers 8m
- Revisiting the RAII Idiom 6m
- Implementing Copy Semantics 8m
- Using this Pointer to Implement Assignment Operators 8m
- Rvalue References and Value Categories in C++ 7m
- Implementing Move Semantics 7m
- Optimizing Performance with Copy Elision and xvalues 7m
- Summary 4m
- Introducing Standard Arrays 11m
- Using Algorithms with Iterators 4m
- Optimizing Array Management with C++20 Ranges 8m
- Using Vectors to Implement Dynamic Arrays 7m
- Vectors Size and Capacity 7m
- Inserting Elements at a Specific Position 3m
- Erase-remove Idiom 9m
- Owning Resources with Smart Pointers 7m
- Implementing Exclusive Ownership with Unique Pointers 7m
- Sharing the Ownership with Shared Pointers 9m
- Observing Resources with Weak Pointers 4m
- Summary 5m