

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

extern char **environ;

void whereis(char *name, void *p);

int main(int argc, char **argv)
{
	int y;
	int *p = malloc(sizeof(int));
	whereis("y", &y);
	whereis("p", p);
	whereis("environ", environ);
	whereis("main", main);
	whereis("whereis", whereis);
	
}

void whereis(char *name, void *p)
{
	printf("%s = %p (main + %lx)\n",name, p,
		((uintptr_t)p - (uintptr_t)main));
}
