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. 🙂
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
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.
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!
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.
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 ?
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.
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
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 !
Thank you professor!!! You are the best C tutor. I think its you very deep know computers. Why not so many subscribers?
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. 🙂
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
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.
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!
The best C tutor on RUclips
Thank you very much! :-)
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!
Thank you for the positive feedback, I’m glad you enjoyed the video! :-)
I want you to be my sensei from now on
Your videos are so helpful, thank you so much!
You’re welcome Charlie! :-)
You really know what you’re doing ❤❤
Excellent explanation! Thanks!
What is appening here? You make me love C !!!! Thanks ❤❤
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.
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 ?
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.
Excellent.
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?
You're welcome Timothy! :-) And yes, realloc() does free the old memory space if the address changes.
Does realloc automatically free the original block after copying it to the new block?
It doesn’t 19:56
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
wow, that was impressing!
I'm glad you enjoyed it Alex! :-)
The best!
Thanks
You're welcome Reinhard! 😀
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 !
Yes Muhi, realloc() can definitely be used in this situation. :-)
you are the god
thanks
You're welcome Hamza! :-)