#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <stdlib.h>
#include <unistd.h>

extern int edata, etext, end;

int main()
{
	char *buffer;
	
	printf ("\n This is initial state \n");

        printf(" \t etext: %6X \t edata: %6X \t end: %6X \n", &etext, &edata, &end);


	if ((buffer=(char *) malloc((unsigned) 20)) != NULL)
		printf ("\n This is after buffer is allocated in the data area \n");

	malloc((unsigned) 400);
	malloc((unsigned) 400);
	malloc((unsigned) 400);

	printf(" \t etext: %6X \t edata: %6X \t end: %6X \n", &etext, &edata, &end);

	free(buffer);
	
	printf ("\n This is after buffer is freed from mem \n");

	printf(" \t etext: %6X \t edata: %6X \t end: %6X \n", &etext, &edata, &end);
	
	return(0);
}
