I am working on a poker game. I have figured out what code I need, but it has 1 problem.

I am working on the code that chooses a random card for each player (2 players) plus all the cards on the table (5). However, the part the problem appears at is the code for making sure that no two cards are identical.

Here is the code...Scroll down beneath the code the see what problems I get.

The Error appears at the lines:Code:#include <iostream> using namespace std; int main ( int argc , char** argv ) { // -- Variables -- // int totalpoints1=0; int suit1=0; int totalpoints2=0; int suit2=0; int randnum1; // Opponents first card string card1; int randnum2; // Your first card string card2; int randnum3; // Opponents second card string card3; int randnum4; // Your second card string card4; string communitycard1; int suitcc1; string communitycard2; int suitcc2; string communitycard3; int suitcc3; string theturn; int suittt; string theriver; int suittr; int quit=1; // if quit is 0 then game over // -- No More Variables -- // // -- Begin Main Game Loop -- // while(quit==1) { randnum1 = rand() % 52 ; randnum2 = rand() % 52 ; randnum3 = rand() % 52 ; randnum4 = rand() % 52 ; communitycard1 = rand() % 52 ; communitycard2 = rand() % 52 ; communitycard3 = rand() % 52 ; theturn = rand() % 52 ; theriver = rand() % 52 ; // -- Begin Card Choosing System -- // if(randnum1=1) {card1="Ace of Hearts"; suit1=1;} else if(randnum1=2) {card1="Ace of Diamonds"; suit1=2;} else if(randnum1=3) {card1="Ace of Spades"; suit1=3;} else if(randnum1=4) {card1="Ace of Clovers"; suit1=4;} else if(randnum1=5) {card1="Two of Hearts"; suit1=1;} else if(randnum1=6) {card1="Two of Diamonds"; suit1=2;} else if(randnum1=7) {card1="Two of Spades"; suit1=3;} else if(randnum1=8) {card1="Two of Clovers"; suit1=4;} else if(randnum1=9) {card1="Three of Hearts"; suit1=1;} else if(randnum1=10) {card1="Three of Diamonds"; suit1=2;} else if(randnum1=11) {card1="Three of Spades"; suit1=3;} else if(randnum1=12) {card1="Three of Clovers"; suit1=4;} else if(randnum1=13) {card1="Four of Hearts"; suit1=1;} else if(randnum1=14) {card1="Four of Diamonds"; suit1=2;} else if(randnum1=15) {card1="Four of Spades"; suit1=3;} else if(randnum1=16) {card1="Four of Clovers"; suit1=4;} else if(randnum1=17) {card1="Five of Hearts"; suit1=1;} else if(randnum1=18) {card1="Five of Diamonds"; suit1=2;} else if(randnum1=19) {card1="Five of Spades"; suit1=3;} else if(randnum1=20) {card1="Five of Clovers"; suit1=4;} else if(randnum1=21) {card1="Six of Hearts"; suit1=1;} else if(randnum1=22) {card1="Six of Diamonds"; suit1=2;} else if(randnum1=23) {card1="Six of Spades"; suit1=3;} else if(randnum1=24) {card1="Six of Clovers"; suit1=4;} else if(randnum1=25) {card1="Seven of Hearts"; suit1=1;} else if(randnum1=26) {card1="Seven of Diamonds"; suit1=2;} else if(randnum1=27) {card1="Seven of Spades"; suit1=3;} else if(randnum1=28) {card1="Seven of Clovers"; suit1=4;} else if(randnum1=29) {card1="Eight of Hearts"; suit1=1;} else if(randnum1=30) {card1="Eight of Diamonds"; suit1=2;} else if(randnum1=31) {card1="Eight of Spades"; suit1=3;} else if(randnum1=32) {card1="Eight of Clovers"; suit1=4;} else if(randnum1=33) {card1="Nine of Hearts"; suit1=1;} else if(randnum1=34) {card1="Nine of Diamonds"; suit1=2;} else if(randnum1=35) {card1="Nine of Spades"; suit1=3;} else if(randnum1=36) {card1="Nine of Clovers"; suit1=4;} else if(randnum1=37) {card1="Ten of Hearts"; suit1=1;} else if(randnum1=38) {card1="Ten of Diamonds"; suit1=2;} else if(randnum1=39) {card1="Ten of Spades"; suit1=3;} else if(randnum1=40) {card1="Ten of Clovers"; suit1=4;} else if(randnum1=41) {card1="Jack of Hearts"; suit1=1;} else if(randnum1=42) {card1="Jack of Diamonds"; suit1=2;} else if(randnum1=43) {card1="Jack of Spades"; suit1=3;} else if(randnum1=44) {card1="Jack of Clovers"; suit1=4;} else if(randnum1=45) {card1="Queen of Hearts"; suit1=1;} else if(randnum1=46) {card1="Queen of Diamonds"; suit1=2;} else if(randnum1=47) {card1="Queen of Spades"; suit1=3;} else if(randnum1=48) {card1="Queen of Clovers"; suit1=4;} else if(randnum1=49) {card1="King of Hearts"; suit1=1;} else if(randnum1=50) {card1="King of Diamonds"; suit1=2;} else if(randnum1=51) {card1="King of Spades"; suit1=3;} else if(randnum1=52) {card1="King of Clovers"; suit1=4;} /////////////////////////////////////////// while(1==1) { if(randnum2=1) {card2="Ace of Hearts"; suit2=1;} else if(randnum2=2) {card2="Ace of Diamonds"; suit2=2;} else if(randnum2=3) {card2="Ace of Spades"; suit2=3;} else if(randnum2=4) {card1="Ace of Clovers"; suit1=4;} else if(randnum2=5) {card2="Two of Hearts"; suit2=1;} else if(randnum2=6) {card2="Two of Diamonds"; suit2=2;} else if(randnum2=7) {card2="Two of Spades"; suit2=3;} else if(randnum2=8) {card2="Two of Clovers"; suit2=4;} else if(randnum2=9) {card2="Three of Hearts"; suit2=1;} else if(randnum2=10) {card2="Three of Diamonds"; suit2=2;} else if(randnum2=11) {card2="Three of Spades"; suit2=3;} else if(randnum2=12) {card2="Three of Clovers"; suit2=4;} else if(randnum2=13) {card2="Four of Hearts"; suit2=1;} else if(randnum2=14) {card2="Four of Diamonds"; suit2=2;} else if(randnum2=15) {card2="Four of Spades"; suit2=3;} else if(randnum2=16) {card2="Four of Clovers"; suit2=4;} else if(randnum2=17) {card2="Five of Hearts"; suit2=1;} else if(randnum2=18) {card2="Five of Diamonds"; suit2=2;} else if(randnum2=19) {card2="Five of Spades"; suit2=3;} else if(randnum2=20) {card2="Five of Clovers"; suit2=4;} else if(randnum2=21) {card2="Six of Hearts"; suit2=1;} else if(randnum2=22) {card2="Six of Diamonds"; suit2=2;} else if(randnum2=23) {card2="Six of Spades"; suit2=3;} else if(randnum2=24) {card2="Six of Clovers"; suit2=4;} else if(randnum2=25) {card2="Seven of Hearts"; suit2=1;} else if(randnum2=26) {card2="Seven of Diamonds"; suit2=2;} else if(randnum2=27) {card2="Seven of Spades"; suit2=3;} else if(randnum2=28) {card2="Seven of Clovers"; suit2=4;} else if(randnum2=29) {card2="Eight of Hearts"; suit2=1;} else if(randnum2=30) {card2="Eight of Diamonds"; suit2=2;} else if(randnum2=31) {card2="Eight of Spades"; suit2=3;} else if(randnum2=32) {card2="Eight of Clovers"; suit2=4;} else if(randnum2=33) {card2="Nine of Hearts"; suit2=1;} else if(randnum2=34) {card2="Nine of Diamonds"; suit2=2;} else if(randnum2=35) {card2="Nine of Spades"; suit2=3;} else if(randnum2=36) {card2="Nine of Clovers"; suit2=4;} else if(randnum2=37) {card2="Ten of Hearts"; suit2=1;} else if(randnum2=38) {card2="Ten of Diamonds"; suit2=2;} else if(randnum2=39) {card2="Ten of Spades"; suit2=3;} else if(randnum2=40) {card2="Ten of Clovers"; suit2=4;} else if(randnum2=41) {card2="Jack of Hearts"; suit2=1;} else if(randnum2=42) {card2="Jack of Diamonds"; suit2=2;} else if(randnum2=43) {card2="Jack of Spades"; suit2=3;} else if(randnum2=44) {card2="Jack of Clovers"; suit2=4;} else if(randnum2=45) {card2="Queen of Hearts"; suit2=1;} else if(randnum2=46) {card2="Queen of Diamonds"; suit2=2;} else if(randnum2=47) {card2="Queen of Spades"; suit2=3;} else if(randnum2=48) {card2="Queen of Clovers"; suit2=4;} else if(randnum2=49) {card2="King of Hearts"; suit2=1;} else if(randnum2=50) {card2="King of Diamonds"; suit2=2;} else if(randnum2=51) {card2="King of Spades"; suit2=3;} else if(randnum2=52) {card2="King of Clovers"; suit2=4;} if(card1==card2 && suit1==suit2) {} // Rechoose the card until they are different else {break;} } // -- End Card Choosing System -- // cout << "The dealer hands your opponent a card.\n"; cout << "The dealer hands you a card.\n"; cout << "You got a \""; cout << card2; cout << "\"\n"; cout << "The dealer hands your opponent a card.\n"; cout << "The dealer hands you a card.\n"; cout << "You got a \""; cout << card4; cout << "\"\n"; } // -- End Main Game Loop -- // }

If I haveCode:if(card1==card2 && suit1==suit2) {} else {break;}then no compile errors appear, but the program does not function. It opens the console window and then nothing happens. Hitting any key does nothing whatsoever.Code:if(card1==card2 && suit1==suit2)

If I havethen the compile error:Code:if(card1=card2 && suit1=suit2)

I don't know what to do since I am relativly new to C++.Code:int function 'int main(int, char**)': no match for 'operator&&' in 'card2 && suit1' candidates are: operator&&(bool, bool) <built-in>

Also, another question. Is there anyway to make this code better? As in decreasing the amount of code or anything along those lines?