- 923 名前:デフォルトの名無しさん [2007/09/07(金) 10:38:36 ]
-
int main(void) { st* pst; // make struct object pst = (st*)malloc(3); if(pst == NULL) { printf("st is null\n"); } else { for(int i = 0; i < 3; i++) { // make struct member pst[i].ppsz = (char**)malloc(2); for(int j = 0; j < 2; j++) { // make member area pst[i].ppsz[j] = (char*)malloc(10); } } // free memory freeif(pst); } return 0; }
|

|