#include <stdlib.h> #include <malloc.h> #include <string.h>
typedef struct _M { int plen; char *p; char pp[20]; } MM;
main() { MM **ss; int i; char str[20];
strcpy(str,"sasfdfs"); ss=(MM **)malloc(sizeof(MM *)*1000); for(i=0;i<1000;i ){ ss[i]=malloc(sizeof(MM)); ss[i]->p=(char *)malloc(sizeof(char *)*100); } for(i=0;i<1000;i ){ memcpy(ss[i]->p,str,7); } for(i=0;i<1000;i ){ if(ss[i]->p)free(ss[i]->p); if (ss[i])free(ss[i]); } if(ss)free(ss);
}