Unique Pointer In C++

Описание к видео Unique Pointer In C++

JOIN ME
—————
YouTube 🎬    / @cppnuts  
Patreon 🚀   / cppnuts  

COMPLETE PLAYLIST
————————————
C++ Tutorial For Beginners :
   • Introduction To C++  
STL (Standard Template Library) :
   • STL In C++  
ThreadIng In C++ :    • Multithreading In C++  
Data Structures:    • Data Structure  
Algorithms:    • Binary Search  
Design Patterns:    • Factory Design Pattern in C++  
Smart Pointers:    • Smart Pointer In C++  
C++14:    • Digit Separator In C++  
C++17:    • std string_view in C++17 | Fastest St...  
C++ All Type Casts:    • static_cast In C++  

INTERVIEW PLAYLIST
————————————
C++ Interview Q&A:    • Structural Padding & Packing In C & C++  
C++ Interview Q&A For Experienced:    • How delete[] Knows How Much  To Deall...  
Linked List Interview Questions:    • Find Kth Node From Back In Singly Lin...  
BST Interview Questions:    • Search Element In Binary Search Tree ...  
Array Interview Questions:    • Reverse An Array  
String Interview Questions:    • Check String Is Palindrome Or Not  
Bit Manipulation Questions:    • Find Set Bit In Integer Number  
Binary Tree Interview Question:    • Invert Binary Tree  
Sorting Algorithms:    • Bubble Sort  
C++ MCQ:    • Видео  
C MCQ:    • What printf returns after printing? |...  
C Interview Questions:    • Designated Initialization In C  

QUICK SHORT VIDEOS
————————————-
C++ Short :    • C++ Short Videos  
C Short :    • Shorts C Programming MCQ  

In this video we will learn about one of the smart pointer called unique pointer in c++. It is written as unique_ptr.

NOTES:
0. unique_ptr is a class template.
1. unique_ptr is one of the smart pointer provided by c++11 to prevent memory leaks.
2. unique_ptr wraps a raw pointer in it, and de-allocates the raw pointer,
when unique_ptr object goes out of scope.
3. similar to actual pointers we can use arrow and * on the object of unique_ptr, because it is overloaded in unique_ptr class.
4. When exception comes then also it will de-allocate the memory hence no memory leak.
5. Not only object we can create array of objects of unique_ptr.

#stl #cpp #programming #tutorial #interviewquestions #softwareengineering #computerscience

Комментарии

Информация по комментариям в разработке