SMART POINTERS in C++ (for beginners in 20 minutes)

CodeBeauty
CodeBeauty
96 هزار بار بازدید - 3 سال پیش - A smart pointer is a
A smart pointer is a container/wrapper for a raw pointer. In modern C++ smart pointers are defined in the std namespace in the memory header file.
One big advantage of smart pointers is that they are responsible for deleting the memory that they use, which means that they automatically deallocate the memory when they go out of scope.
There are three types of smart pointers in C++: unique pointer, shared pointer and weak pointer (std::unique_ptr, std::shared_ptr, std::weak_ptr)

📚 Learn how to solve problems and build projects with these Free E-Books ⬇️
C++ Lambdas e-book - free download here: https://bit.ly/freeCppE-Book
Entire Object-Pascal step-by-step guide - free download here: https://bit.ly/FreeObjectPascalEbook

🚀📈💻🔥 My Practical Programming Course: https://www.codebeautyacademy.com/
Experience the power of practical learning, gain career-ready skills, and start building real applications!
This is a step-by-step course designed to take you from beginner to expert in no time!
💰 Here is a coupon to save 10% on your first payment (CODEBEAUTY_YT10).
Use it quickly, because it will be available for a limited time.

Download Visual Assist here:  https://bit.ly/WT-CB
I use it to enhance the performance, features, and support for C, C#, and C++ development in Visual Studio.
Download Ultra Edit here: https://bit.ly/UE-CB
It is a powerful, secure text editor designed specifically for programmers.

☕ If you've found my content helpful and would like to support me, you now have the option to buy me a coffee or a cookie! It's a small gesture of gratitude that means a lot to me and helps me keep creating free educational videos for you. Use the link to make a contribution: https://bit.ly/CodeBeauty_BuyMeACoffee
However, please don't feel obligated to do so. I appreciate every one of you, and I will continue to share valuable content with you regardless of whether you choose to support me in this way. Thank you for being part of the Code Beauty community! ❤️😇

Contents:
00:00 - Intro
00:47 - What are smart pointers in C++
01:39 - Unique pointer in C++
04:10 - Sharing vs moving a unique pointer in C++
06:44 - Unique pointer automatic memory deallocation
11:42 - Shared pointers in C++
15:09 - Shared pointer automatic memory deallocation
18:42 - Weak pointer vs shared pointer in C++

How to install and use PVS-Studio - How to detect errors and bugs in code...
Object Oriented Programming - https://bit.ly/Cpp_OOP_Playlist
C++ Pointers -  C++ POINTERS FULL COURSE Beginner to ...
Learn Exception handling - Exception handling in C++ (How to han...

Tag me on you Instagram stories:
Instagram 📸 - Instagram: TrueCodeBeauty
Twitter 🐦- Twitter: TrueCodeBeauty
3 سال پیش در تاریخ 1400/03/19 منتشر شده است.
96,055 بـار بازدید شده
... بیشتر