struct containing string array without predefined size

I want to make a struct which, among others, contains an array of std::strings. But I don't want to define the size of this array in the struct definition, but when initializing a variable of this struct type. Is that possible?

1
2
3
4
5
6
7
8
9
10
11
...
struct myStruct
{
    ...
    std::string str_arr [];
    ...
};
...
struct myStruct xy;
--> here, I want to (permanently) define the size of xy.str_array!
...
1
2
3
4
5
6
7
8
9
10
struct myStruct
{
    ...
    std::vector<std::string> vectorOfStrings;
    ...
};


myStruct xy;
xy.vectorOfStrings.resize(34);


Thanks for the fast answer. It works perfectly.
Topic archived. No new replies allowed.