class Card
{
public:
Card(int Value, int Suit, char Name[50]);
~Card();
private:
int itsValue;
int itsSuit;
char itsName[50];
};
Card::Card(int Value, int Suit, char Name[50])
{
itsValue = Value;
itsSuit = Suit;
itsName = Name;
}
Card::~Card()
{
}
Card game
So, I'm making a simple card game and I have a problem with a class I've made for the cards:
When I compile it I get: error C2440: '=' : cannot convert from 'char[]' to 'char [50]'
Does anyone know how to fix this?
itsName = Name;
Thats the line that is giving you problems right? Try this instead.
Thats the line that is giving you problems right? Try this instead.
memcpy( itsName, Name, 50 );
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement