No, when you defined it here: void sumArray();
You are saying it has no arguments.
Here it has 2 arguments:
8 9
void sumArray(int mehdi[2][2],int shah[2][2]){
int sum[2][2];
You should do it like this:
1 2 3 4 5 6 7 8 9
void sumArray(int mehdi[2][2], int shah[2][2]);
void main()
{
int shahgee[2][2];
int n[2][2];
sumArray(shahgee,n);
}
void sumArray(int mehdi[2][2],int shah[2][2]){
int sum[2][2];
void main() is not valid. It should always be int main().
You need to declare arguments in your function when you declare it. Take this example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#include <iostream>
void MyFunction(int x, int y); //Function arguments must be declared here!
int main()
{
int n = 44;
int i = 94;
MyFunction(n,i);
return 0;
}
void MyFunction(int x, int y)
{
int z = x * y;
std::cout << z << "\n";
}