#include /** * Casting a pointers in C. Just because you can * does not mean you should * @author gtowell * Created: March 2021 * **/ int main(void) { int iint = 5; int *intp = &iint; printf("T1int%12d%12d\n", iint, intp); *intp = 999999; printf("T2int%12d%12d\n", iint, intp); char *chrp = (char *)intp; //this changes the content of the first byte at the pointer location! *chrp = 'a'; printf("T3chr%12c%12d\n", *chrp, chrp); printf("T3int%12d%12d\n", *intp, intp); }