#include "card.h"
#include<iostream>
usingnamespace std;
int main()
{
card temp, chosen, prize; //define various cards
int position;
card card1(7, clubs); //define & initialize card1
cout << "\nCard 1 is the ";
card1.display(); //display card1
card card2(jack, hearts); //define & initialize card2
cout << "\nCard 2 is the ";
card2.display(); //display card2
card card3(ace, spades); //define & initialize card3
cout << "\nCard 3 is the ";
card3.display(); //display card3
prize = card3; //prize is the card to guess
cout << "\nI’m swapping card 1 and card 3";
temp = card3; card3 = card1; card1 = temp;
cout << "\nI’m swapping card 2 and card 3";
temp = card3; card3 = card2; card2 = temp;
cout << "\nI’m swapping card 1 and card 2";
temp = card2; card2 = card1; card1 = temp;
cout << "\nNow, where(1, 2, or 3) is the ";
prize.display(); //display prize card
cout << " ? ";
cin >> position; //get user’s guess of position
switch (position)
{ //set chosen to user’s choice
case 1: chosen = card1; break;
case 2: chosen = card2; break;
case 3: chosen = card3; break;
}
if (chosen.isEqual(prize)) //is chosen card the prize?
cout << "That’s right!You win!";
else
cout << "Sorry.You lose.";
cout << " You chose the ";
chosen.display(); //display chosen card
cout << endl;
return 0;
}
its the header in the main
some project i copy paste from internet to understand why always my compiler says unreslved externals.-problem 1
and Error 1 error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup C:\Users\***\Documents\Visual Studio 2013\Projects\EX2\cards\MSVCRTD.lib(crtexew.obj) cards
You picked the wrong kind of Visual Studio project when you created a new project. Make a new one, and make sure it's a plain, ordinary console project. Not a windows project.