0
Hi ! I just solve DejaVu Challenge in C, but rigth to the point. do you think it can be improved by using malloc for list array?
2 Respuestas
0
Heap allocation won't improve this great code. Only one thing reducant is that {0*LIST_SIZE} is as same as {0}. You don't need to do multiplication.
You might need to read some posts like Heap vs Stack. I suggest viewing this thread: https://stackoverflow.com/questions/161053/which-is-faster-stack-allocation-or-heap-allocation
0
Oh thanks! I'll have a look at it..
Yes! That multiplication has no sense 😅. I wanted to initialize the whole array with zeros but I better use a for.
That idea came to me from anoter language, but it works just for characters
Thanks CarrieForle !!