Hi I am working on a basic array question and I am trying to create an array
of empty strings. I am not permitted to use a vector here.
I declared the string array correctly and the size is a reference pased from another function.
Code:
std::string employeeNames[ rSIZE ] = { "" };
But I got 1 error saying
Code:
salary charter.cpp variable-sized object `employeeNames' may not be initialized
I do not know why, as say If I had an integer array i could use the { 0 } format to initilize all the elements to zero. Is the a special case for strings that only vectors permit? Of course the below is valid but I cannot use it.
Code:
std::vector<std::string> employeeNames ( 10, "" );