You can't assign values to the array that way, that syntax is only valid for initialization.
Why don't you use vectors?
1 2 3 4 5 6 7 8 9
//Header
//declare the vectors
vector<string> fromdefine1, fromdefine2;//You can make those static members for mystruct
void InitVectors();
struct mystruct
{
vector<string> names;
//...
};
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
//Source
//set values to vectors
void InitVectors()
{
fromdefine1.push_back("name1");
//...
}
//Entry point
int main()
{
InitVectors();//call the function that will set the values for your vectors
//...
}
//Somewhere
{
myst.names = condition ? fromdefine1 : fromdefine2;
}