How can I initialize and use an static constant string array? I made an example, the header:
const static string validFileTypesToSendToClient[];
The implementation:
const string Settings::validFileTypesToSendToClient[] = {"html","css","js"};
This works, but how can I use this? For example in this case:
string fileTypesToAllow[] = Settings::validFileTypesToSendToClient;
I get the error:
Initialization with ‘{…}’ expected for aggregate object.
So, how can I use a static constant array of string in a proper way? I already found this: Initializing a static const array of const strings in C++ but they don’t describe how to use it.