I would like to add something that happened to me while using realloc. It's wise to use a temp variable to store the address that realloc returns, because it can happen that due to memory fragmentation you don't have enough space to expand your array, which results in realloc returning NULL. You wouldn't only be unable to store anything, but you would actually also loose the memory address of your array and produce a memory leak, as the original memory segment is still reserved, just not pointed to by anything.
@CodeVault3 жыл бұрын
Oh, that's a good point, thanks!
@mavrix23564 жыл бұрын
Thanks for the Clean and clear explanation..
@davidliverman47422 жыл бұрын
Thanks for your time. God bless!
@weeb20062 жыл бұрын
in the other video, malloc() was type casted with (int*) but why it wasn't necessary in 1:18?
@CodeVault2 жыл бұрын
In C it's optional to type cast the result of malloc. I may be inconsistent in some videos at times
@nandorboda8049Ай бұрын
These vids are so usefull!
@anaalcazar65333 жыл бұрын
Hey there ! plz I need ur help. When we define a binary search tree with a root that contains INFINITY value does it mean that the right subtree is nonexistent ?
@CodeVault3 жыл бұрын
I guess? Why would you ever do that to a binary tree though? You usually want to balance those trees so they are efficient
@matteopisati99663 жыл бұрын
thank you very much !
@chenwu97882 жыл бұрын
do you have videos talking about vector and matrix computations?
@CodeVault2 жыл бұрын
No. There is a library I used in the past called kazmath: github.com/Kazade/kazmath
@chenwu97882 жыл бұрын
@@CodeVault many thanks, do you know if the lib can do complex matrix /vector calculations
@CodeVault2 жыл бұрын
I guess it's limited to matrices and vectors of maximum size 4. Since this is more of a computer graphics library. For actual math applications there is this: www.gnu.org/software/gsl/ It probably has whatever you need in there, you have to read the documentation a bit since it can be quite complex to use
@chenwu97882 жыл бұрын
how to do arr substract p using for loop, and without using for loop?
@CodeVault2 жыл бұрын
With just a for loop: for (int i = 0; i < 64; i++) arr[i] -= p; I don't know how you'd do it without a for loop
@chenwu97882 жыл бұрын
@@CodeVault does c have array/matrix lib for matrix calculation?