When I assign a pointer, like this
and when I want to treat it as an array by doing something like thisCode:int *p;
how the computer knows that, for example, the p+4 adress it's not in use?Code:for(i=0;i<10;i++) scanf("%d",&p[i];
I mean how the heck does this work?
P.S.I've heard that you can somehow allocate memory in order to use it using malloc(), but I've seen that the above code is working without using malloc.