bool function check question

What im trying to do here is to check if the numbers stored in compcards[] match with what the user inputed and return whether theres a match or not. Is the logic im using in the bool checkMatch function correct or should I use something else

https://gist.github.com/anonymous/5cd22373bdfb14bd9f84
Last edited on
Wrong. You do return during checking the first element, whether it is a match or not. If your intent is to answer "Is any of elements equal to key?", then you have to check all.

Btw, your compcards has only four elements, but your loop would look for five.
are my if statements wrong? cant find bug

https://gist.github.com/anonymous/5cd22373bdfb14bd9f84
Topic archived. No new replies allowed.