Pointers and References in C++: Allocating Memory with New & Delete Operators
C++
| Intermediate
- 13 videos | 1h 25m 18s
- Includes Assessment
- Earns a Badge
C++, like C, has powerful support for memory allocation and deallocation. In the world of C, these operations are performed using malloc() and free(), which are not to be used in the C++ world. In classic C++, memory allocation and deallocation are performed using the new and delete operators. You will begin this course by understanding the new and delete keywords, and note how these lead to the invocation of the underlying constructors and destructors on whatever objects are being worked with. In contrast, the C versions, that is, malloc() and free(), do not invoke constructors or destructors. You will then move on to the use of array new and array delete, which is how the new and delete followed by square brackets are referred to. Finally, you will look at the differences between const pointers and pointers to consts.
WHAT YOU WILL LEARN
-
Discover the key concepts covered in this courseExplore pointers and stack and free store memoryContrast malloc() and newUse the new keyword to allocate memory on the heapUse the new and delete keywords on pointersAllocate memory for strings and vectorsAllocate memory for arrays using array new and delete
-
Invoke constructors and destructors on arraysContrast const pointers and pointers to constsCreate constant variables and pointers on those variablesCreate constant pointers on constant and non-constant variablesCreate constant pointers and constant pointers to constantsSummarize the key concepts covered in this course
IN THIS COURSE
-
2m 8s
-
6m 2s
-
7m 29s
-
6m 49s
-
7m 49s
-
6m 37s
-
5m 20s
-
7m 53s
-
7m 46s
-
8m 34s
-
8m 6s
-
7m 30s
-
3m 15s
EARN A DIGITAL BADGE WHEN YOU COMPLETE THIS COURSE
Skillsoft is providing you the opportunity to earn a digital badge upon successful completion on some of our courses, which can be shared on any social network or business platform.
Digital badges are yours to keep, forever.