we know in gcc the the size of int is 4 bytes and we want to print the individual bytes of it ....eg. like if we have a integer variable (unsigned int a=256) the equivalent binary representation is (00000000)(00000000)(00000001)(00000000). code:
unsigned int a=256; char *p=&a; int i=0; for(i=0;i<4;i++) printf("%d ",*(p+i));