fork download
  1. #include <stdio.h>
  2.  
  3. int main ()
  4. {
  5.  
  6. int i; /* loop index */
  7. int values [5] = {10, 567, 56, 23, 78};
  8.  
  9. /* loop and print the contents and address of each array element */
  10.  
  11. printf("Address\t\tArray Element\tContents\n\n");
  12. for (i=0; i < 5; ++i)
  13. {
  14.  
  15. printf("%lx \tValues [%i] \t%i \n", &values[i], i, values[i] );
  16. }
  17.  
  18. return (0);
  19.  
  20. }
Success #stdin #stdout 0s 5284KB
stdin
Standard input is empty
stdout
Address		Array Element	Contents

7ffce2a8b950 	Values [0] 	10 
7ffce2a8b954 	Values [1] 	567 
7ffce2a8b958 	Values [2] 	56 
7ffce2a8b95c 	Values [3] 	23 
7ffce2a8b960 	Values [4] 	78