fork download
  1. #include <stdio.h>
  2.  
  3. int main ()
  4. {
  5.  
  6. int myValue = 50; /* simple integer value to test */
  7.  
  8. int *ptr = &myValue; /* ptr is a pointer to an integer and now contains */
  9. /* the address of the variable named myValue */
  10. int i2 = *ptr / 2 + 10;
  11. printf ("Before function call: myValue = %i and *ptr = %i \n", i2, ptr);
  12.  
  13. /* call the function and pass the contents of the pointer ptr, */
  14. /* which contains the ADDRESS of the variable myValue */
  15.  
  16. return (0);
  17. }
  18.  
Success #stdin #stdout 0s 5268KB
stdin
Standard input is empty
stdout
Before function call:  myValue = 35 and *ptr = -751068252