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.