hello!
i'm trying to write a code which get variable as int and put them at 2D array...
this a code which i wrote, it is the first time i'm trying to do thing like that.
very importent it will be Recursion and without any loops.
thanks!
Code:void scanMatrix(int matrix[][18],int indexRow, int indexCol, int sizeRow, int sizeCol){ int num; if(indexCol == sizeCol && indexRow == sizeRow) return; matrix[indexRow][indexCol]=scanf("%d",&num); if(indexCol != sizeCol) return scanMatrix(matrix,indexRow,indexCol+1,sizeRow,sizeCol); if(indexCol == sizeCol) return scanMatrix(matrix,indexRow+1,indexCol,sizeRow,sizeCol); }



LinkBack URL
About LinkBacks


