realloc Basics

Поделиться
HTML-код
  • Опубликовано: 9 июл 2021
  • An overview of using realloc() in C. Source code: github.com/portfoliocourses/c.... Check out www.portfoliocourses.com to build a portfolio that will impress employers!
  • ХоббиХобби

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

  • @anuragdhami5968
    @anuragdhami5968 2 месяца назад +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

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

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

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

  • @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! :-)

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

    Your videos are so helpful, thank you so much!

  • @nuelzemudio883
    @nuelzemudio883 29 дней назад +1

    I want you to be my sensei from now on

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

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

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

    You really know what you’re doing ❤❤

  • @mohamedcoulibaly-py9zu
    @mohamedcoulibaly-py9zu 9 месяцев назад

    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 ?

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

    The best C tutor on RUclips

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

    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.

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

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

    wow, that was impressing!

  • @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. :-)

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

    The best!

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

    Thanks

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

    you are the god

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

    thanks

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

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

    • @nuelzemudio883
      @nuelzemudio883 29 дней назад

      It doesn’t 19:56

    • @adi4961
      @adi4961 2 дня назад

      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