how can i call this function in main?plz tell me

int main(){
int shahgee[2][2];
int n;
sumArray(shahgee,n)//error is too many argument in function call

 
  void sumArray(int mehdi[2][2],int shah[2][2],int sum[2][2])
You need to be more clear.

Please show us the function prototype, the function definition, and the call that's causing the error.
just tell me how i call function

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# include<iostream>
# include<conio.h>
using namespace std;
void sumArray();
void main()
{
	int shagee[2][2];






}
	void sumArray(int mehdi[][2],int shah[][2],int sum[][2]){
closed account (jwkNwA7f)
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])
how can i change into 2 argument?should i write int sum[2][2] inside the body of function?
That depends on what you want.

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.
Last edited on
Topic archived. No new replies allowed.