/* A program that outputs the location of certain
   variables and pointers in the (virtual) address space. 
   Written by Andre M. Maier, dhbw@andre-maier.com */

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

void d(){}

int main(int argc, char **argv)
{
   int a;
   static int b=3;
   int* c = malloc(1);
   void (*d_ptr)() = &d;
   printf("Local Stack Variable:\t%p\n",&a);
   printf("Static Variable:\t%p\n",&b);
   printf("Heap Pointer:\t\t%p\n",c);
   printf("Function Pointer:\t%p\n",d_ptr);
   return 0;
}
