How to initialize static const char array for ASCII codes [C++]
- by Janney
I want to initialize a static const char array with ASCII codes in a constructor, here's my code:
class Card
{
public:
Suit(void)
{
static const char *Suit[4] = {0x03, 0x04, 0x05, 0x06}; // here's the problem
static const string *Rank[ 13 ] = {'A', '2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K'}; // and here.
}
However i got a whole lot of errors stating that
'initializing' : cannot convert from 'char' to 'const std::string *'
'initializing' : cannot convert from 'int' to 'const std::string *'
please help me! Thank you so much.