Program not displaying correct output all the time

figured it out!!
Last edited on
1
2
if (secondp[0] == secondp[1] || secondp[1] == secondp[2] || secondp[2] == secondp[3] || secondp[3] == secondp[4])
					cout << "\nPair" << endl;


Look at this function. In your example, the "four" cards are secondp[1] and secondp[3]. Those cards are not compared with each other.
I think that you should compare [0] with [1], [2], [3] and [4], then [1] with [2], [3] and [4], then [2] with [3] and [4], and the last will be [3] and [4].
Thank you!! It works :)
Please DON'T delete your question after getting an answer. It makes this thread useless for others to learn from.
Topic archived. No new replies allowed.