#include <stdio.h>
char *thebuf;

char *
get_buf()
 {
char *abuf;

 abuf = (char *) malloc(2000);
printf("add of abuf = %ld\n",abuf);
return abuf;
}

loadbuf(buf) 
char buf[][10];
{
int i,x;
char str[10];

for (i = 0; i < 10; i++) 
{
printf("top\n");
printf("add of buf = %ld\n",buf[i]);
  sprintf(str,"%d bbbbb",i);
  strcpy(buf[i],str);
  printf("%d - %s\n",i,buf[i]);
printf("bot");
if (i == 9)
  break;
}
}



printbuf() 
{
int i,x;
char buf[][10],*c;

for (i = 0; i < 10; i++) 
{
printf("top\n");

/*   printf("%d - %s\n",i,thebuf + (i*10)/(sizeof(c))); */
   printf("%d - %s\n",i,thebuf + (i*10)*(sizeof(c))); 

printf("bot\n");
printf("i = %d\n",i);

}

}

main()
{


printf("add ofthebuf = %ld\n",thebuf);
thebuf = get_buf();
printf("add ofthebuf = %ld\n",thebuf);
loadbuf(thebuf);
 printbuf(thebuf); 


}
