#include <stdio.h>


struct my_complex {
  int re, im;
};

typedef struct my_complex cplx;
  
int main() {
  struct my_complex x;
  cplx y;

  x.re = 2;
  x.im = 3;
  
  printf("Hello world!\n");

  printf("X real part is: %d, X imaginary part is: %d \n", x.re, x.im);

  printf("Size of X variable is: %lu\n", sizeof(x));

  int narray[] = {1,2,3,4,5};
  printf("Second element of the array: %d\n", narray[1]);

  int n2array[20];

  printf("tenth element of the narray: %d\n", narray[11]);

  int a = 5;

  int *pa = &a;

  printf("a: %d, *pa: %d, pa: %p\n", a, *pa, pa); 
  
  for (int i = 0; i < 6; i++) {
    printf("The %d th number in the array is: %d\n", i, *(narray+i));
  }

  cplx *px = &x;

  printf("real part of x is: %d\n", (*px).re);
   printf("real part of x is: %d\n", px->re);
  
  return 0;
}