• Advertisement

Archived

This topic is now archived and is closed to further replies.

Vb vector sizes

This topic is 5036 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Is there any funtion that can get us the size of a vector? I have many vectors that are defined by the user input(Redim instruction) and after the input i wanna know the size of each vector (they can be all diferent sizes).

Share this post


Link to post
Share on other sites
Advertisement
You mean the size of an std::vector? Sure, just use vector.size();

Share this post


Link to post
Share on other sites
I haven''t used VB in a while but I believe UBound() would work.


Thanks Salsa!Colin Jeanne | Invader''s Realm
"I forgot I had the Scroll Lock key until a few weeks ago when some asshole program used it. It even used it right" - Conner McCloud

Share this post


Link to post
Share on other sites
Unless things have changed dramatically since I last heard, the STL is a C++ thing and not a VB thing...

Share this post


Link to post
Share on other sites
quote:
Original post by Instruo
Unless things have changed dramatically since I last heard, the STL is a C++ thing and not a VB thing...

Of course...

Well, going on topic again, the answer is, if I understood right, to use UBound(array).

I mean, if you''re calling an "array" as a "vector"... Actually a "vector" is a type composing of X, Y and Z parts.

Share this post


Link to post
Share on other sites
Be sure to handle the UBound as the number of elements-1 (if using option base 0, the default).

-Nik

Share this post


Link to post
Share on other sites

  • Advertisement