I am wondering, if this is correct, or not, considering the lifetime of the strings in the vector "strings". This is a simplified version of some actual code, which runs just fine, but anyway, I suspect, that the contents of the vectors is actually invalid at the point, where it is accessed (by printf in this case).
If this is correct, would it still be, if SomeStruct were a class with the same initializing list being used in the constructor? With assignments instead of the initializing list?
Would it be correct, if the objects, stored in the vector, were not strings but vectors of strings?
When you push_back(), you are making a copy of what you pass into the vector. That means that test.strings.c_str() does not contain residual memory which was released at the end of the for loop, but a permanent copy of whatever you had pushed into the vector before. This will not go out of scope until the vector<SomeStruct> test goes out of scope.
So you're safe!
You only have to start worrying when pointers are involved. That's why pointers are discouraged in C++.