Resolved Question: bool operator in lottery program? by Lotto

Search

Sun, 08 Jan 2012 18:00:21 -0600

Resolved Question: bool operator in lottery program?

by Lotto @ Sun, 08 Jan 2012 18:00:21 -0600
I am creating a function that will compare 2 lottery tickets right now i have bool function that is meant to return false if it doesnt match and true if it does. Here is the code, the only thing i cant seem to do is call this value and output true or false. how do you do that? bool operator==(lotto_ticket a, lotto_ticket b){ for (int i=1; i<=6; i++) { if (! (a.at(i) == b.at(i)) ) {return false; }sorry didnt see thatbool operator==(lotto_ticket a, lotto_ticket b){for (int i=1; i<=6; i++){if (! (a.at(i) == b.at(i)) ){return false; }elsereturn true;}ok but how do i call the function? lets say i wanna output that the result is false how do i do that?