function does not take 3 arguments

Now my program could not be complied since it says my mcnuggets function does not take 3 arguments. I don't even know why, please help! thanks.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
  #include<iostream>
using namespace std;

void mcnuggets(int n);





int main(){
	int input[9],size[10];

	cout<<"Welcome to McDonald's HK, what would you like to order?";
    cout<<"(A)How many of Chicken McNuggets(s) you want to order(at least 4)? ";cin>>input[0];
    cout<<"(B)How many set of McWings(s) you want to order? ";cin>>input[1];
    cout<<"(C)How many of McSpicy Chicken Filet(s) you want to order? ";cin>>input[2];
    cout<<"(D)How many of Sausage McMuffin with Egg(s) you want to order? ";cin>>input[3];
    cout<<"(E)How many of Filet - O - Fish(s) you want to order? ";cin>>input[4];
    cout<<"(F)How many of (small) Soft Drink(s) you want to order? ";cin>>input[5];
    cout<<"(G)How many of (small) Fries(s) you want to order? ";cin>>input[6];
    cout<<"(H)How many of Apple Pie(s) you want to order? ";cin>>input[7];
    cout<<"(I)How many of Ice - cream(s) you want to order? ";cin>>input[8];

	if(input[0]==4 || (input[0]>=6 && (input[0]%3==0 || (input[0]-4)%3==0) ) ){
		if((input[0]-4)%3==0) input[0]-=4;
		if(input[0]!=4) mcnuggets(input[0],size[0],size[1]);
	}

	else cout<<"No solution !"<<endl;
	cout<<size[0]<<" "<<size[1]<<endl;
	return 0;
	
}

void mcnuggets(int n,int value1,int value2){
	bool stop(0);
	for(int i=0;i<=n/6;i++){
		if (stop)break;  
		for(int x=0;x<=n/6;x++){ //n/6 is the largest posible no. of meals or A la carte
			if(n-i*6-x*9==0){
				value1=i;
				value2=x;
				stop=1;
				break;
			}
			
		}
	}
}
on line 4 you declare this
void mcnuggets(int n);

and on line 35 you define the function as needing 3 arguments
void mcnuggets(int n,int value1,int value2){

The compiler is complaining because they are different.
Thanks I got it fixed now. New question now. What does * and & mean?
1
2
3
4
5
6
7
void changeThem(int *X, int *Y) {
 (*X) = 3;
 (*Y) = 6;
}

// Called like:
changeThem(&a, &b);
Topic archived. No new replies allowed.