const
gives namespace-scoped variables internal linkage, that's why it works, effectively the same as
static const std::string error[] = {"a", "b"};
The second one doesn't work because it's not the variable that is const, but the char
s it consists of.