Dynamic Memory with Malloc - Everything you Need to Know

Поділитися
Вставка
  • Опубліковано 3 гру 2024

КОМЕНТАРІ • 15

  • @codebreakthrough
    @codebreakthrough  Рік тому

    🌟Be notified of new C/C++ course: calcur.tech/c-cpp-newsletter

  • @Dulge
    @Dulge Рік тому +5

    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.

  • @ElementResources-rp8ox
    @ElementResources-rp8ox Рік тому +3

    Really nice examples in this video...well done and thank you!

  • @goaheadskinit
    @goaheadskinit 10 місяців тому

    Thank you for your explanation. Really helpful.

  • @m4daruba309
    @m4daruba309 6 місяців тому

    Thank you very much. Very helpful.

  • @itzikovadia851
    @itzikovadia851 15 днів тому

    Thanks u very helpfull and clearly lesson

  • @byskawica1919
    @byskawica1919 4 місяці тому

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

  • @tixerz9591
    @tixerz9591 3 місяці тому

    helped me alot. thanks.

  • @andrewcomtois6542
    @andrewcomtois6542 9 місяців тому

    very helpful

  • @kermitdafrog8
    @kermitdafrog8 Рік тому

    Do you use calloc at all?

  • @tixerz9591
    @tixerz9591 3 місяці тому

    now i have the idea to make dynamic lists like cpp vectors in c

  • @TheBuilder
    @TheBuilder Рік тому

    good job

  • @bilos125
    @bilos125 Місяць тому

    good

  • @typingcat
    @typingcat Рік тому

    Dang, 8 years changes the voice and the face. Unrecognisable. (I came from a 8-year-old database video).

  • @reenamola2162
    @reenamola2162 Рік тому +1

    first