First thing, your should replace your function signature double phi(i, n)
by double phi(int i, int n)
. The same goes for the theta function. Also, in your code, you have written this line :
T[i][j]*=theta(i-1,n)*phi(j+1)/theta(n-1,n);
Your phi function should take 2 parameters, so maybe you wanted this :
T[i][j]*=theta(i-1,n)*phi(j+1, n)/theta(n-1,n);
I would also suggest you to use T[i][j]=pow((double)(-1), (double)(i+j));
.
You can see the signatures of pow here.