Question: I have done type casting with `int` and `char` but not with pointers so I posted this question.

```
#include <stdio.h>
int main() {
    int a[4] = { 1, 2, 6, 4 };
    char *p;
    p = (char *)a;   // what does this statement mean?
    printf("%d\n",*p);
    p = p + 1;        
    printf("%d",*p);  // after incrementing it gives 0 why?
}

```

The first call to `printf` gives the first element of the array. And after `p=p+1` it gives `0`. Why?

Answer: 
You have an array of four integers. You try to access them as an "array" of characters. That's what the casting means.

As for the second `printf` printing zero, remember that integers are four bytes while characters are only one. So increasing the pointer `p` will make `p` point to the second byte of the first integer, which is zero. If you had a larger number (i.e. over 255) then the second byte would have a value as well. But note that this only works on Intel-type machines, which are *little endian*, on *big endian* machines both `printf` would print zero.
If you use an intel like processor the bytes on the stack are stored using the little endian format. In more, probably the type int (on your computer) has size 4 bytes while char is 1 byte long (you can verify this using the c operator 'sizeof'), so the first element of your integer array is:

```
0x04 0x00 0x00 0x00

```

For this reason when you use a char pointer to see the values of your integer array, you proceed forward one bytes at time (not 4) with the obvious result you've obtained.

I hope this helps!