fork download
  1. // George Juarez
  2.  
  3. #include <stdio.h>
  4.  
  5. int main(void){
  6. int y = 5;
  7. int *yPtr;
  8. yPtr = &y; // assigns the address of the variable y to pointer yPtr
  9. // if the y is at address 600000, then yPtr is assigned to 600000
  10. printf("%d\n", *yPtr); // prints the value of variable y
  11. // called dereferencing a pointer because unary * operator returns the value of the object to which its operand (pointer) points
  12. printf("%d", &yPtr);
  13.  
  14. return 0;
  15. }
  16.  
Success #stdin #stdout 0s 2156KB
stdin
Standard input is empty
stdout
5
-1080862468