int* func(int* arr,int rowIndex,int row) { int pre=1,temp=0; for (int i=0; i<row+1; i++) { if (i==0 || i==row) { arr[i] = 1; continue; } temp = arr[i] + pre; pre = arr[i]; arr[i] = temp; } if (row==rowIndex) return arr; return func(arr,rowIndex,row+1); } int* getRow(int rowIndex, int* returnSize){ int* arr= (int*)calloc(34,sizeof(int)); *returnSize = rowIndex+1; return func(arr,rowIndex,0); }