argument in a switch

Dec 7, 2009 at 4:33pm
I'm trying to call a function in a switch, but I'm not sure which arguments to call. The problem is in the int main() function at the bottom


I've tried adding arguments for both the memberInfo and dvdMovie structures because the char are being compared to them respectively.
Last edited on Dec 8, 2009 at 3:48pm
Dec 7, 2009 at 5:02pm
Arguments are not called. The function currently takes only 3 arguments. The commented out call is trying to pass 4 which obviously makes no sense. 3 != 4. The arrays appear to have the same size therefore you only need to pass one number to the function that indicates this.
Dec 7, 2009 at 5:41pm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
switch(choice){
    	    case 1:
	    //....
	    case 2:
	    //....
	    case 3:
//Problem>> rentMovie(SIZE, numberOfItems, numberOfUsers);
	    cout<<"\n";
	    break;
	    case 7:
	    break;
	}
	    //Clears everything but menu on screen
	    system("PAUSE");
	    system("CLS");
    }
	return 0;
}


I tried using the const int SIZE, but it didn't work. It says:
error C2664: 'rentMovie' : cannot convert parameter 1 from 'const int' to 'memberInfo []' 333
Last edited on Dec 8, 2009 at 3:49pm
Dec 7, 2009 at 5:44pm
The arguments passed must be the same number and the same type as the function parameters
Dec 7, 2009 at 5:50pm
I changed all of the char arrays to have the same size, but I'm still getting the same result.
Topic archived. No new replies allowed.