char *ptr;
long *p;
printf("%d\t%d\n",sizeof(*ptr),sizeof(*p));
This is not printing the size of the pointers but the size of the types they are pointing to.
printf("%d\t%d\n",sizeof(char *),sizeof(long *));
this is printing the size of the pointers
When you addressing byte you shoudn't worry about which type of value placed there.
This is not actually true because C does not guarantee that pointers to different types have the same size or bit pattern. However on many (most?) systems today pointers to different types do have the same size and bit pattern. Sometimes programmers rely on this which in theory makes their code non-portable, however in practice this is not often a problem.
However just because it is not a problem doesn't mean you can ignore it, you should know it in case you happen to work on a system where pointers to different types are of non-equal size or bit pattern.