Dynamische Speicherallokation
-
Hallo Alle
Ich habe vergessen wie man ein 2 Dimensionales Array dynamisch allokieren kann. Kann mir bitte einer wieder auf die Sprünge helfen...
Danke
-
int i,x,y; x=... y=... typ **my2darray = (typ**)malloc(sizeof(typ*)*x); for(i=0;i<x;++i)my2darray[i]=(typ*)malloc(sizeof(typ)*y); . . . for(i=0;i<x;++i)free(my2darray[i]); free(my2darray);