Skip to main content
GameDev.net gamedev.net
🔒 Locked

[java] question about vectors

Started by gbizzle Mar 7, 2005 at 9:33 PM 2 replies 400+ views
Original Post
gbizzle
gbizzle
I know that vectors have the ability to expand their size. Am I supposed to call a special add command to increase the size of a vector? In other words, can I tell the vector to insert some object at a specific location, and if the vector is not already that big, it will automatically stretch? hope that makes sense, thanks everyone
Zahlman
Zahlman
All you need to know.

You can insert anywhere within the vector, from 'at the beginning' to 'at the end'. Items will get pushed back to make room for the insertion (e.g. if you insert at the beginning, then everything is shifted; if you insert at the end, then it just gets tacked on to the end and nothing else moves). The vector will resize itself as needed.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.