Return a value

how would I modify this code to return an integer value to main to compare if player one's card number is greater than player two's.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
int playerone(Card * const wDeck)
{
    cout << "PLAYER ONES'S CARDS: " << endl;

    for (int i = 0; i < 1; i++)
		cout << wDeck[ i ].face << " of " << wDeck[i].suit << endl;

}
int playertwo(Card * const wDeck)
{
    cout << "PLAYER TWO'S CARDS: " << endl;

    for (int j = 1; j < 2; j++)

		cout << wDeck[ j ].face << " of " << wDeck[j].suit << endl;
}
What kind of information should the integer have?
When run the program spits out a random card for player one and player two.
Example "Player one's card: 10 of hearts Player two's card: two of clubs" I need to return just the 10 and the 2 to main so I can compare them and see what number is larger?

I'm really a noob still. Sorry if this doesn't really answer your question.
Last edited on
Topic archived. No new replies allowed.