Doubt regarding initializing dp array

i defined the dp array inside the robotpath function which was defined and then defined in the main as " INT DP[1001][1001]={0};" then it gave me the output as 10
But when i used memset function in the main like in the video and defined dp array as global then the ans came correct as 2.
I want to ask why is that so?

A “zero” in a floating point variable is not necessarily the same as
“all bits zero”. ‘memset’ clears all bits. and therefore use of memset is recommended

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.