im tring to make a simple card game i thought up, and below is a part of the code for the deck of cards.
struct Hand {
int card[7][7];
int numberOfCards[7];
};
Hand SystemHand;
SystemHand.numberOfCards[1] = 6;
void Draw(int player) {
while(SystemHand.numberOfCards[player] < 6) {
int randomCard = dbRND(1000);
int cardDrawn;
for(int i = 1; i < 32; i++) {
if(randomCard > DeckTotals[i] && randomCard < DeckTotals[i+1]) {
cardDrawn = i;
SystemHand.numberOfCards[player]++;
Hand.card[Hand.numberOfCards[player]+1][player] = cardDrawn;
for(int i = i; i >= 0; i--) {
DeckTotals[i] --;
}
}
}
}
}
which gives the errors
1>c:usersandydocumentsvisual studio 2008projectsprismprismcards.h(86) : error C2143: syntax error : missing \\\';\\\' before \\\'.\\\'
1>c:usersandydocumentsvisual studio 2008projectsprismprismcards.h(86) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:usersandydocumentsvisual studio 2008projectsprismprismcards.h(86) : error C2371: \\\'SystemHand\\\' : redefinition; different basic types
1> c:usersandydocumentsvisual studio 2008projectsprismprismcards.h(85) : see declaration of \\\'SystemHand\\\'
1>c:usersandydocumentsvisual studio 2008projectsprismprismcards.h(96) : error C2143: syntax error : missing \\\';\\\' before \\\'.\\\'
1>c:usersandydocumentsvisual studio 2008projectsprismprismcards.h(96) : error C2143: syntax error : missing \\\';\\\' before \\\'.\\\'
i havent used structs a lot, but aren\\\'t my declarations correct?
-to the optimist, the glass is half full. to the pessimist, it is half empty, to the engineer, it is twice as big as it needs to be.