I am trying to declare an array of strings representing suits in a deck of cards in my header file and initialize it in my implementation file. I have tried initializer_list as well as tried to initialize it within my constructor, but nothing worked. I finally came across this link Initializing a static const array of const strings in C++, but I don't understand why this works and the previous methods do not.
Why is char used here
static const char * const days[]
instead of string? Why is a pointer being used?
I am confused why I simply cannot declare and initialize the array in my header file as well.
std::array,std::stringand an initializer list.