/* In C, explicitly converting a pointer type changes how the pointer operations are performed, * but not the bits themselves (i.e. the address doesn't change) */ #include #include int main (int argc, char *argv[]) { int *a = malloc( sizeof(int) ); // malloc returns a void* and some compilers complain if you dno't explicitly case to an int* *a = 2000000000; // make the number huge unsigned char *ptr = (unsigned char *)a; // now, point to that huge number, but point only to its first byte. printf( "%d %d\n", *a, *ptr ); // print them both out... different operations. *a looks at 4 bytes as an int. *ptr interprets 1 byte as an int }