Question: So I have been learning how to work with pointers and this simple program won't run and I can't figure out what is wrong
I think the problem is this line of code:

```
printf("Address of pointer variable = %x \n",pointer_p);

```

I also tried with `printf("Address of pointer variable = %x \n",&pointer_p);` still no results.

```
#include <stdio.h>
#include <stdlib.h>

int main() {    
    int val = 30;
    int *pointer_p;
    pointer_p = &val;
    //shows the address of val (hexadecimal)
    printf("Address of val = %x\n", &val);
    printf("Address of pointer variable = %x\n", pointer_p);
    //shows the value of this address
    printf("Value of pointer = %d\n", *pointer_p);

    return 0;
}

```

Answer: 
To print addresses of any kind, you have to use `%p` and cast the pointer to `void*`:

```
printf("Address where pointer is pointing = %p\n", (void*) pointer_p);
printf("Address of pointer variable = %p\n", (void*) &pointer_p);

```

See [printf documentation](https://linux.die.net/man/3/printf)

Please bear in mind, that `pointer_p` returns the address it's pointing to. If
you want the address of the variable, you have to use `&pointer_p`. See the
`printf`s above.
You are using the wrong format specifier. 

use `%p` instead of `%x` like this : 

```
printf("Adress pointed to  = %p \n", pointer_p);
printf("Adress of pointer = %p \n", &pointer_p);

```

here is a [link](https://www.le.ac.uk/users/rjm1/cotter/page_30.htm) that may be useful.