#include <stdio.h>
#define ARRAY_SIZE 10
void print_array(int a[], int array_size) {
  printf("[");
  int *p;
  for (p = a; p < a + array_size; p++) {
    if (p == &a[array_size - 1]) {
      printf("%d", *p);
    } else {
      printf("%d, ", *p);
    }
  }
  printf("]\n");
}

int main() {
  int a[ARRAY_SIZE] = {1, 2, 3, 4, 5, 6, 7, 80, 90, 100};
  print_array(a, ARRAY_SIZE);
  printf("*a:\t%d\n", *a);
  int *ap1 = &a[1];
  *ap1++ = 99;
  printf("Executing *ap1++:\n");
  print_array(a, ARRAY_SIZE);
  printf("*ap1 after execution:\n");
  printf("%d\n", *ap1);
  int *ap2 = &a[2];
  *(ap2)++ = 88;
  printf("Executing *(ap2)++:\n");
  print_array(a, ARRAY_SIZE);
  printf("*ap2 after execution:\n");
  printf("%d\n", *ap2);
  int *ap3 = &a[3];
  *++ap3 = 77;
  printf("Executing *++ap3:\n");
  print_array(a, ARRAY_SIZE);
  printf("*ap3 after execution:\n");
  printf("%d\n", *ap3);
}
