fork download
  1. #include <stdio.h>
  2. int main()
  3. {
  4. int a = 10; /* a is a variable of type integer */
  5.  
  6. int *int_ptr; /* int_ptr is a variable which is a pointer to variables of type integer */
  7.  
  8.  
  9. int_ptr = &a; /* put the address (not the contents) of a into the variable int_ptr*/
  10.  
  11. /* since addresses in memory can be quite long, its best */
  12. /* to print them in long hexidecimal format */
  13. printf ("%i %lx %x %lx %i \n", a, &a, int_ptr, &int_ptr, *int_ptr);
  14.  
  15. return (0);
  16.  
  17. }
Success #stdin #stdout 0.01s 5276KB
stdin
Standard input is empty
stdout
10 7fffd04999cc d04999cc 7fffd04999d0 10