#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>

#define PRINTIT(X) \
  do { \
    printf("Location of %-7s is %0*lX\n", \
    #X, 16, (unsigned long)(void *)X) ;\
  } while(0)

uint32_t Aglobal[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
const uint32_t Aconst[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
uint32_t Abss[10] ;

void subr(void) {
  uint32_t ASlocal[10] ;
  PRINTIT(ASlocal) ;
}

int main(int argc, char** argv) {
  uint32_t AMlocal[10] ;
  uint32_t *Amalloc ;
  Amalloc = (uint32_t *)malloc(10*sizeof(uint32_t)) ;
  PRINTIT(Aglobal) ;
  PRINTIT(Aconst) ;
  PRINTIT(Abss) ;
  PRINTIT(Amalloc) ;
  PRINTIT(AMlocal) ;
  subr() ;
  PRINTIT(main) ;
  PRINTIT(subr) ;
  PRINTIT(printf) ;
  
  return (EXIT_SUCCESS);
}

