Working with an empty vector.

So after creating an empty vector what is the correct process to add information to it. For example I have created two parallel vectors and the information inside position one for both vectors needs to be related, can I just use the push_back function to add the information? If using the push_back function will the information be added to the vector in numerical order, as in the first item in the vector will be the first argument I passed using the push_back function and the second item in the vector will be the second argument passed using push_back? Is there a better member function for vectors that I can be using? Thanks for any help and tips.

Have you considered using a structure of a class instead of the parallel vectors?

Yes, use push_back(). That adds the value to the end of the vector. Once a value is placed in a vector, it's position doesn't change (unless you add/delete in the middle of the vector).
Topic archived. No new replies allowed.