Q:

How does the size of a pointer change when it is pointing at a single character and when at a dynamically declared array of long integers? C code

I know that an array declaration results in a block of memory being reserved, but with an array represented by a pointer this does not.  As it contains the address of the first element of the array.  
But concerning how the size changes from pointing to a single long int, to a dynamically declared array of long integers, any explanation on the subject would be much appreciated.
Kind regards
Example :
long int *plint = 5; // size is the same as

long int *arr;

arr = (long int*)malloc(5*(sizeof(long int));

Is size arr is the same as size plint ?
If not how does it change size?

A:

I imagine your code looks something like this:
long *ptr = 0;
long ra[10];
printf("%d %d\n", (int)(sizeof(ptr)), (int)(sizeof(ra)) );

In this case ra is not a pointer, and its size is not the size of a pointer.
&ra[0] is a pointer to the first element, so you could do:
print("%d\n", (int)(sizeof(&ra[0])));

You'll see that it's the same size as ptr.
In most cases, when you use ra in an expression it "decays" to a pointer to its first element. But sizeof is not one of those cases.

A:

Pointer is a special variable, store address of another variable. Address of a variable is an Integer and will take size same as that of normal Integer variable. Consider following code snippet. 
         char c ='a';
         char *ptr = &c; 

Here c is character will take 1 byte and ptr is char pointer variable(not char variable). So size of ptr is same as that of size of integer.
Now,
         int* ptr = (int*) malloc(10*sizeof(int));

again size of ptr is same as that of size of integer though it's pointing to block of size (10*size of int)

