Linear search function quick question

Hey guys. I need to write a linear search function in C++ for my CS2020 class. I just really need a basic template/overview on how to do so because the example given in the book doesn't really apply to the current problem.

I need to have the user enter a winning lottery number then do a search of an array that I named Luckynums to see if one of the users numbers matches the winning number.
The array numbers are all a set value that I declared in the beginning of the function, the user always picks the same 10 numbers so when they enter the winning number it will just search to see if it matches one of the numbers they chose. It then needs to save the spot in the array like if the 3rd number was a winner it would save Luckynum[2] to another variable. If no number is a winner then it has to return a -1 and display a message that the number was not found.

Thanks guys.
Topic archived. No new replies allowed.