Dynamic Arrays of Objects (Data Structures course, step-by-step)
CodeBeauty CodeBeauty
274K subscribers
16,944 views
0

 Published On Premiered Aug 2, 2023

In this video you will learn how to create both static and dynamic arrays of objects, how to insert data, copy from one array to another, and of course how to delete data from an array of objects. One very important topic that we will discuss in this video is memory management and how your application is using resources where I will point out some of the common mistakes. We will also learn the difference between deep and shallow copying of data, which is very important when working with arrays of objects and can be very tricky if you don't know it well. For that, I will show you different techniques like using built-in "memcpy" function as well as working with loops.
As always, there are a few practical tasks included in this video just waiting for you to solve them so be sure to share your solution with others down in the comment section. Put on your learning hat and join me in this detailed video but also stay tuned for upcoming parts of this serial, because I'm probably working on them as you are watching this :D.

📚 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.

☕ 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. You can use the link below 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! ❤️😇

Related videos:
Array Data Structure (for absolute beginners) -    • DATA STRUCTURES - How to work with ar...  
Arrays of objects, step-by-step, in-depth -    • Arrays of objects - Introduction (Dat...  
C++ Copy constructors -    • C++ Copy constructors (beginner-frien...  
Exception handling in C++ -    • Exception handling in C++ (How to han...  
Assignment Operators - will be linked soon

Download PVS-Studio for free here:
http://bit.ly/PVS-StudioFreeCB1

Contents:
00:00 Summary of what you'll learn (Dynamic Memory and Arrays of Objects)
02:46 Example showcase
03:28 Creation of static array of objects
04:00 Why do we need dynamic arrays?
04:38 Creation of dynamic array of objects
06:55 Difference between static and dynamic arrays
08:44 Deallocating memory
10:42 Visual example of memory allocation (how arrays are allocated)
12:29 Tools for code analyzing
13:05 Entering data in an array using loops
16:42 Arrays and functions (passing a dynamic array into a function)
21:12 Changing size of the dynamic array at runtime (visual explanation)
26:40 Changing the size of the dynamic array at runtime (code example)
28:24 Copying elements from one array to another using "memcpy" function
30:32 Copying elements from one array to another using loops
31:50 Adjusting existing logic
34:43 Practical task for you (with instructions)
37:50 Problem with "memcpy" function
41:00 Deep copy VS Shallow copy
44:16 Second practical task for you
45:41 Final words

Add me on other platforms for more educational content:
Instagram 📸 -   / truecodebeauty  
Twitter 🐦-   / truecodebeauty  

******CODE IS IN THE COMMENTS******

show more

Share/Embed