Dynamic Memory with Malloc - Everything you Need to Know

Поделиться
HTML-код
  • Опубликовано: 11 дек 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.

  • @itzikovadia851
    @itzikovadia851 23 дня назад

    Thanks u very helpfull and clearly lesson

  • @m4daruba309
    @m4daruba309 6 месяцев назад

    Thank you very much. Very helpful.

  • @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 10 месяцев назад

    very helpful

  • @TheBuilder
    @TheBuilder Год назад

    good job

  • @tixerz9591
    @tixerz9591 3 месяца назад

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

  • @kermitdafrog8
    @kermitdafrog8 Год назад

    Do you use calloc at all?

  • @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