/******************************
*	malloc_1.c
*	19.03.2002
******************************/

#include <stdio.h>
#include <stdlib.h>

int main(void)
{
 char *str[10];
 int i;

 printf("Zadej 10 retezcu:\n");
 for(i=0; i<10; i++)
 {
  if((str[i] = malloc(128)) == NULL)
  {
   printf("Chyba pri alokaci");
   exit(1);
  }
  gets(str[i]);
 }
 
 /* uvolneni pameti */
 for(i=0; i<10; i++)
  free(str[i]);
 printf("Alokace i uvolneni pameti probehlo uspesne");

 return 0;
}