I've corrected that problem, but I figure I need to actually push_back cards into the vector before adjusting their values, why isn't this doing the job?
Code:
for (y = 0; y < 4; y++)
{
for (x = 0; x < 13; x++)
{
Cards.push_back(new Card);
Cards[loopvar].suit = y;
Cards[loopvar].value = x;
loopvar++;
}
}
It gives me this error:
Code:
------ Build started: Project: Blackjack, Configuration: Debug Win32 ------
Compiling...
Blackjack.cpp
c:\visual studio 2005\projects\blackjack\blackjack\deck.h(30) : error C2664: 'std::vector<_Ty>::push_back' : cannot convert parameter 1 from 'Card *' to 'const Card &'
with
[
_Ty=Card
]
Reason: cannot convert from 'Card *' to 'const Card'
No constructor could take the source type, or constructor overload resolution was ambiguous
c:\visual studio 2005\projects\blackjack\blackjack\blackjack.cpp(14) : warning C4244: 'argument' : conversion from 'time_t' to 'unsigned int', possible loss of data
Deck.cpp
c:\visual studio 2005\projects\blackjack\blackjack\deck.h(30) : error C2664: 'std::vector<_Ty>::push_back' : cannot convert parameter 1 from 'Card *' to 'const Card &'
with
[
_Ty=Card
]
Reason: cannot convert from 'Card *' to 'const Card'
No constructor could take the source type, or constructor overload resolution was ambiguous
Hmmm, I used to be able to do this just fine, maybe not this syntax but the same idea..... now I'm failing at code..