Quick notes is that this memory is allocated on rhe heap and the heap is much slower than the stack where your local variables and data is stored. Using dynamic memory is powerful when we working with huge classes or structs or when we need our data to have a longer lifetime even when out of scope. Its also very useful when we need to have a buffer for the user input.
🌟Be notified of new C/C++ course: calcur.tech/c-cpp-newsletter
You could also use this altogether :
”
int* x = malloc(sizeof(int) *4);
*(x + n) = y; // n is the list index and y is the assigned value.”
Quick notes is that this memory is allocated on rhe heap and the heap is much slower than the stack where your local variables and data is stored. Using dynamic memory is powerful when we working with huge classes or structs or when we need our data to have a longer lifetime even when out of scope. Its also very useful when we need to have a buffer for the user input.
Really nice examples in this video...well done and thank you!
Thank you for your explanation. Really helpful.
Thank you very much. Very helpful.
very helpful
good job
Do you use calloc at all?
Dang, 8 years changes the voice and the face. Unrecognisable. (I came from a 8-year-old database video).
first