How to store values in a vector that is inside of another vector

I am writing a program where I need to use the following data structure:

struct shape
{
//declare the variables in the struct
std::vector<float> verts; //contains the x &y values for each vertex
char type; // the type of shape being stored.
float shapeCol[3]; //stores the color of the shape being stored.
float shapeSize; //stores the size of the shape if it is a line or point
};

In my main program I need a vector of type "shape". How would I store values into the struct using the the vector of shapes.

For instance, vector<shape> myshapes;

If I wanted to store a value into the first index of my "verts" vector, inside of my first index of my "myshapes" vector how would I do this?

in pseudo code it would look something like this, with "i" being the index:
myshapes[i].vector[i]= 4;

would this be easier to implement using a STL list instead and if so what would that syntax look like?

Thanks for the help I am new to vectors so any help would be appreciated.
1
2
3
4
5
// modify the value of vertex 'j' of shape 'i'
myshapes[i].verts[j] = 4.5; 

// add one more vertex to shape 'k'
myshapes[k].verts.push_back(6.7) ;

Topic archived. No new replies allowed.