// A program to introduce you to another variable type // POINTERS! // Sasha 22T3, Week 4: Pointers - a basic intro #include int main(void) { // Demonstrating a normal variable // Declare a variable and assign a value to it // (declare and initialise normal variable) int my_variable = 13; // Declare a pointer and assign the address of // my_variable to it (declare and initialise a pointer) int *my_variable_ptr = &my_variable; // Example of dereferencing a pointer printf("The pointer variable my_variable_ptr has value %p\n", my_variable_ptr); printf("This pointer has its own address: %p\n", &my_variable_ptr); printf("It is pointing to the variable my_variable, which has value %d\n", *my_variable_ptr); return 0; }