/////////////////////////////// // // prog_practice_5 project // // 9/19/22 // // practice with pointers // //////////////////////// #include "mbed.h" #include int main(void){ setbuf(stdout, NULL); // fix buffer issue // splash printf("Pointer practice program\n\n"); int a; int b; float c; int * a_ptr; // show random memory values and locations using address-of printf("a with value %i is stored at memory location %p\n", a, &a); printf("b with value %i is stored at memory location %p\n", b, &b); printf("c with value %f is stored at memory location %p\n\n", c, &c); //show initialized memory values and location using address-of a = 5; b = 6; c = 7.1; printf("a with value %i is stored at memory location %p\n", a, &a); printf("b with value %i is stored at memory location %p\n", b, &b); printf("c with value %f is stored at memory location %p\n\n", c, &c); // create and show pointer variable value and location a_ptr = &a; printf("a_ptr with value %p is stored at memory location %p\n", a_ptr, &a_ptr); printf("*a_ptr with value %i is stored at memory location %p\n\n", *a_ptr, a_ptr); // update value using indirection *a_ptr = 9; printf("a with value %i is stored at memory location %p\n", a, &a); return 0; }// end main