Why a pointer + 1 add 4 actually

Viewed 58497
#include<stdio.h>
int main(void){
  int *ptr,a,b;
  a = ptr;
  b = ptr + 1;
  printf("the vale of a,b is %x and %x respectively",a,b);

  int c,d;
  c = 0xff;
  d = c + 1;
  printf("the value of c d are %x and %x respectively",c,d);
  return 0;
}

the out put value is

the vale of a,b is 57550c90 and 57550c94 respectively
the value of c d are ff and 100 respectively%  

it turns out the ptr + 1 actually, why it behave this way?

6 Answers
Related