got it right this time !!!
Hi Salem....
I guess you are right.. Need not cast the malloc if I use stdlib.h
and "itsme86" , thanX for the suggestion.. but saw ur mail after I corrected my code ;-) but I must thank you too.....
so Ron !!
here is your changed main again
Code:
int main(void)
{
int row; /* row of the matrix */
int column; /* column of the matrix */
int n; /* n is the size of the matrix as mentioned in the question */
n = size();
int **square;
/* Memory allocation for the matrix.... */
square = malloc( n * sizeof(**square));
for (row = 0; row < n; row++)
{
square[row] = malloc( n * sizeof(**square));
}
for (row = 0; row < n; row++)
{
printf("\n");
for (column = 0; column < n; column++)
{
square[row][column] = recursion(row, column, n);
printf("%d ", square[row][column]); /* Prints the Result */
}
}
printf("\n\n");
free(square);
return 0;
}
Regards
Ravi