realloc Basics

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

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

  • @lybava5745
    @lybava5745 2 года назад +20

    Thank you professor!!! You are the best C tutor. I think its you very deep know computers. Why not so many subscribers?

    • @PortfolioCourses
      @PortfolioCourses  2 года назад +6

      You're welcome, and thank you for the kind feedback! 🙂 The channel has only been 'active' for one year now, so maybe later there will be more subscribers. I'll just keep making videos and hopefully more subscribers will come over time, if you're able to share the channel with friends/classmates/social media/etc that would help too. 🙂

  • @anuragdhami5968
    @anuragdhami5968 8 месяцев назад +2

    i am so glad that i find you on youtube ... thank you so muchh!!!!! because of you i got deep understanding of c language .. professor,please launch a full in depth data structure course in c language on udemy so that you will also get what you deserve... i am ready to spend money on you

  • @carmelostagno6352
    @carmelostagno6352 Год назад +2

    I found the best instructions in your site about c programming. Thanks for your help. I learned so much than I will continue to follow you. Excuse me for my English school.

    • @PortfolioCourses
      @PortfolioCourses  Год назад +1

      You're welcome Carmelo, I'm so glad to hear these videos have been helpful for you, thanks for sharing that. :-) And your English seems great to me!

  • @shekomwazadogo8287
    @shekomwazadogo8287 2 года назад +2

    The best C tutor on RUclips

  • @Ithicuss
    @Ithicuss Год назад +5

    Very nicely explained. Definitely helpful in explaining malloc, which is touched upon in CS50's course. This provided helpful background information for the nitty gritty details. Will watch the other videos about this topic as well!

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

      Thank you for the positive feedback, I’m glad you enjoyed the video! :-)

  • @nuelzemudio883
    @nuelzemudio883 6 месяцев назад +1

    I want you to be my sensei from now on

  • @charliebanales5287
    @charliebanales5287 2 года назад +5

    Your videos are so helpful, thank you so much!

  • @youssefaitgouraine5266
    @youssefaitgouraine5266 Год назад +1

    You really know what you’re doing ❤❤

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

    Excellent explanation! Thanks!

  • @eugeniogonzato
    @eugeniogonzato 10 месяцев назад

    What is appening here? You make me love C !!!! Thanks ❤❤

  • @vk3fbab
    @vk3fbab 10 месяцев назад

    Realloc not clearing memory is just a reminder to developers that there are some times that a programs memory can leak. This could be if someone attaches a debugger, runs your process in an emulator, accesses a crash thread dump or somehow manages to inspect a pagefile. So if you are concerned about people inspecting your process you would need to build your own realloc by creating a new object, copying and clearing. But probably having one copy could be too many copies so you have to obfuscate things. Things get hard when people can inspect your binary or your memory or your processor state.

  • @mohamedcoulibaly-py9zu
    @mohamedcoulibaly-py9zu Год назад

    Very gooood, I do have a question , if we free the memory after using realloc is it gonna freed the memory allocated previously in case where realloc allocate new space to store the data ?

  • @vicsteiner
    @vicsteiner 5 месяцев назад

    I also noticed that if you malloc space into pointer a and realloc it into pointer b you cannot free(a). You still have access to the address in a but it seems that realloc frees the variable. Then looking into that value in a it might be the original one or not. On the safety concerns calloc does not seem to solve the issue, we would need a "crealloc" or something that when copies the data from one place to another zeros the original memory value too if I got it right.

  • @aknsagdic9388
    @aknsagdic9388 5 месяцев назад

    Excellent.

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

    Thank you for the easy to follow video! I did have one question though: does realloc free the old memory space if a pointer has to change addresses?

    • @PortfolioCourses
      @PortfolioCourses  Год назад +2

      You're welcome Timothy! :-) And yes, realloc() does free the old memory space if the address changes.

  • @SlideRSB
    @SlideRSB 10 месяцев назад +1

    Does realloc automatically free the original block after copying it to the new block?

    • @nuelzemudio883
      @nuelzemudio883 6 месяцев назад +1

      It doesn’t 19:56

    • @adi4961
      @adi4961 6 месяцев назад +1

      It does free the old space in memory, meaning it can be allocated again, but the values will be kept there and copied to the new place in memory, thats why it is a security risk

  • @Alex.Shalda
    @Alex.Shalda Год назад

    wow, that was impressing!

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

    The best!

  • @reinhardomogware6707
    @reinhardomogware6707 2 года назад +1

    Thanks

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

    Hello :) thnx for this amazing Video! i have one question, if i allocate memory for example to fill new String with old String char but without the Vowels, in this case i dont know at beginneng which size should have the new String..... so can i use realloc to decrease the size of the new String, ofcourse after it be terminated with \0
    thx a lot !

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

      Yes Muhi, realloc() can definitely be used in this situation. :-)

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

    you are the god

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

    thanks