- 132 名前:デフォルトの名無しさん [2009/12/31(木) 08:31:19 ]
- void kakuhoMemory();
int main(void){ int row = 0; char **url; url = (char **)calloc(1,sizeof(char *))) == NULL); url[0] = (char *)calloc(1000,sizeof(char))) == NULL); for(row = 2;row < 10;row++){ kakuhoMemory(url,row); printf("%p---%p\n",url,url[row - 1]); }} void kakuhoMemory(char **url,int row){ char **tmp; if((tmp = (char **)realloc(url,sizeof(char *) * row)) == NULL){ exit(1);} url = tmp; if((url[row - 1] = (char *)calloc(1000,sizeof(char))) == NULL){ exit(1);} }
|

|