Malloc + 2d arrays + C

Peter Pissias petrance at di.uoa.gr
Fri Mar 22 12:26:01 EET 2002


Den xerw an eimai ektos thematos alla
exw thn entypwsh pws gia na kaneis ena allocate
tou styl char** = malloc .....

1) Xreiazetai prwta na kaneis allocate tous pointers 

int x = ...
char** temp = malloc(x * sizeof(char*) );

kai meta :

2) 

for ( ... )
{
	temp[i] = malloc(y * sizeof(char) );
}

kai meta antistrofa free .

Petros Pissias



More information about the Linux-greek-users mailing list