fork download
  1. #include <stdio.h>
  2. #define SIZE 10
  3. int main(void)
  4. {
  5. // 7.9
  6.  
  7. int values[SIZE] = { 2, 4, 6, 8, 10 }; // a
  8. int* vPtr; // b
  9. for (int i = 0; i < SIZE; i++) // c
  10. {
  11. printf("%d, ", values[i]);
  12.  
  13. }
  14. puts("");
  15.  
  16. vPtr = values; // d
  17. vPtr = &values[0];
  18.  
  19. for (int i = 0; i < SIZE; i++) // e
  20. {
  21. printf("%d, ", *(vPtr + i));
  22.  
  23. }
  24. puts(" ");
  25.  
  26. for (int i = 0; i < SIZE; i++) // f
  27. {
  28. printf("%d, ", *(values + i));
  29.  
  30. }
  31. puts(" ");
  32.  
  33. for (int i = 0; i < SIZE; i++) // g
  34. {
  35. printf("%d, ", vPtr[i]);
  36.  
  37. }
  38. puts(" ");
  39.  
  40. // h
  41. printf("%d, ", values[3]);
  42. printf("%d, ", *(values + 3));
  43. printf("%d, ", vPtr[3]);
  44. printf("%d, ", *(vPtr + 3));
  45.  
  46.  
  47.  
  48. }
  49.  
  50.  
  51.  
Success #stdin #stdout 0s 5320KB
stdin
Standard input is empty
stdout
2, 4, 6, 8, 10, 0, 0, 0, 0, 0, 
2, 4, 6, 8, 10, 0, 0, 0, 0, 0,  
2, 4, 6, 8, 10, 0, 0, 0, 0, 0,  
2, 4, 6, 8, 10, 0, 0, 0, 0, 0,  
8, 8, 8, 8,