Hi, I am receiving a linker error when trying to run the program. It has to do with the array I am trying to pass from main into my search function. I know it's probably something I have overlooked. Any assistance and outside views would be appreciated.
You have a linker error because the compiler cannot find a definition for the search function with no arguments. Your search function takes 2 ints as arguments.
As well as that, you did not assign the result to anything - it is supposed to return an int.
The variable winLose would be better as a bool type, use true or false rather than 1 or 0.
With your closing braces, put them directly under the statement that the compound statement belongs to:
27 28 29 30 31 32
if(winLose == 1) {
cout << "Congratulations! You have won!" << endl;
}//end if
else {
cout << "I'm sorry, you have not won this time." << endl;
}//end else
Also, I should have said be careful with variable names - the winLose in main is not the same as the winLose in the search function. Not a problem here, but could cause you grief if not careful.