Dynamic Memory with Malloc - Everything you Need to Know

Поделиться
HTML-код
  • Опубликовано: 5 окт 2024

Комментарии • 13

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

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

  • @Dulge
    @Dulge Год назад +3

    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 11 месяцев назад +1

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

  • @byskawica1919
    @byskawica1919 2 месяца назад

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

  • @goaheadskinit
    @goaheadskinit 8 месяцев назад

    Thank you for your explanation. Really helpful.

  • @tixerz9591
    @tixerz9591 Месяц назад

    helped me alot. thanks.

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

    Thank you very much. Very helpful.

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

    good job

  • @tixerz9591
    @tixerz9591 Месяц назад

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

  • @andrewcomtois6542
    @andrewcomtois6542 7 месяцев назад

    very helpful

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

    Do you use calloc at all?

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