How are you checking if it was initialized properly? Most probably you are doing that wrong because code is absolutely correct:
#include <string>
#include <iostream>
using namespace std;
int
main ()
{
const int sizeOfLicToCheckFor = 3;
string licNameToCheckFor[ sizeOfLicToCheckFor ] = { "PROF", "PERS", "PREM" };
for (int i = 0; i < sizeOfLicToCheckFor; ++i)
{
cout << licNameToCheckFor[i] << endl;
}
}
The output:
$ g++ -o test ./test.cpp
$ ./test
PROF
PERS
PREM
You can also simplify your code by not specifying number of strings in array, like this:
string licNameToCheckFor [] = { "PROF", "PERS", "PREM" };