This has only two arguments, shahgee and n: sumArray(shahgee,n)
This has three arguments, medhi, shah, sum: void sumArray(int mehdi[2][2],int shah[2][2],int sum[2][2])
Presumably, sum contains the results of the function. Do you want sum to be passed back to the calling code? If so, then you need to keep it as an argument, and pass in an array when you call the function.