My God, if I had just watched this 15 minute video before starting my project it would eliminate like 2 hours of confusion...
From the bottom of my heart, thank you SO MUCH for this. I have been having the hardest time understanding pointers because no resource I had found was hitting quite the right spot on why we should care about pointers, but you did it. Thank you for taking the time to demonstrate the memory allocation and your attention to discussing that side of things. I have been pulling my hair out over this, and I cannot tell you how overjoyed I am to have found this video.
I love the commented diagram you made below the code. Really helped a bunch of stuff click.
your courses on C and C++ are the best on the internet. You explain everything perfectly. Thank you very much. Keep up!
Ive been learning C++ as a 1st year CS student from around 5 months now and Im currently dealing with pointers from my book resources. I was very confused about the concept of new and delete operators and was wondering why I should use them and now Im starting to understand their functions and how important they are on memory management, thank you so much!
are you an angel? ive been trying to understand this for days and you're the only one that made it make sense
7:14 int *ptr_to_int = new int(5); // to store an integar. double *array = new double[5]; //to store an array. So, round brackets ( ) to allocate single value and square brackets [ ] to allocate an array with the new operator. So, the basic syntax for the new operator is: datatype *var_name = new datatype(); or datatype *var_name = new datatype(val); //when we pass a value (might be an int or string or any other data type)
You are an amazing teacher
Finally! ...I almost understand dynamic memory allocation. Can we change the names from "heap" & "stack" to something more lay friendly?
such a great explanation
oh shit this tutorial is so good -_- u deserve millions of subscribers
best explanation about dynamic mem allocation
great playlist , you are a hidden gem!
thaank you very much struggling too much on these topic
great video! at 6:47, you have declared a pointer that stores the adress of the first element of an array, right? so, when assigning the values to the array, why couldn't we say, for example, *array[0] = 5?
Thank for this tutorial. But I couldn’t find out a tutorial of yours on placement new. Please can we have a tutorial on that whenever you have time. Thank you once again.
Let's say you have a 2D pointer array of objects and the pieces in the array is dynamically allocated. Why would it be a terrible idea to "delete" a specific entry, arr[i][j] and attempt to assign nullptr afterwards to that entry? I attempted that with a specific piece of code in my chess game in the one case it caused a segfault and the other case it functioned seemingly fine. I am new to C++ so this is a bit confusing.
Just out of curiosity, what is the font used for coding in this video? It looks quite pleasant to me.
I appreciate the work
@mrtom-a-hawk6732