1
0
mirror of https://github.com/kamranahmedse/developer-roadmap.git synced 2025-08-01 06:50:26 +02:00

Change to the correct data type (#4343)

This commit is contained in:
Mikhail Ostashchenko
2023-08-17 03:54:56 +02:00
committed by GitHub
parent 3b7e5d5ce2
commit 5cff162a94

View File

@@ -22,7 +22,7 @@ For example, this code will not have a memory leak:
#include <memory>
void no_memory_leak() {
std::shared_ptr<int> ptr = std::make_shared<int[]>(100); // Allocating memory in the heap for an array of integers using shared_ptr
std::shared_ptr<int[]> ptr = std::make_shared<int[]>(100); // Allocating memory in the heap for an array of integers using shared_ptr
// Some code...
} // shared_ptr goes out of scope and it will automatically deallocate the memory block assigned to it.
```
```