Say i have a vector of structs
and in main i have this vectorCode:struct Crap{ int number; int name; }
Now ive called this to a function that wants to look through this vector of structs. Say i got to the 3rd vector which lets say hadCode:vector <Crap> ca
a number of 10 and a name of john. How do i delete this vector.
I've seen pop_back() and erase() but i havent seen it used for a vector of structs and the syntax is diff because you have to do things like
ca.name to access specific parts of the stuct of elements.
I'm doing this for a program im writing but b/c of my code i hope this example explains what i mean.



LinkBack URL
About LinkBacks


