25.8.0
This website uses cookies to ensure you get the best experience on our website. Learn more

Pointers and References in C++: Allocating Memory with New & Delete Operators

Gaurav singh Yadav

Skillsoft issued completion badges are earned based on viewing the percentage required or receiving a passing score when assessment is required. 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.

Issued on

November 28, 2024

Expires on

Does not expire