I have 2 functions (there are no differences between them, practically) Am I performing a return from them correctly? And how to properly call them in main (between arrays returned by both functions, you will need to perform mathematical operations)?
int summa(int x[], int y[], int nRow) { int *sum = new int[nRow]; for (int i=0; i<nRow; i++) sum[i]=x[i]+y[i]; for (int i=0; i<nRow; i++) return sum[i]; } int dobutok(int x[], int y[], int nRow) { int *dob = new int[nRow]; for (int i=0; i<nRow; i++) dob[i]=x[i]*y[i]; for (int i=0; i<nRow; i++) return dob[i]; }