• Advertisement

Archived

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

Simple question about vectors

This topic is 5238 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

My reference says that functions like at() and resize() takes a parameter of type size_type. How do I know what size_type is for my compiler and will it be different if I use other compilers?

Share this post


Link to post
Share on other sites
Advertisement
quote:
Original post by xg0blin
size_t is defined in stdlib.h I believe, so just look in the file.

He is reffering to size_type which is defined in the std::vector container.

Fold, to answer your question, size_type is defined as a type that can hold any value smaller than the maximum size that a vector container can be for the specific type of objects that it is to hold. Did that make sense? Perhaps someone can explain this better...

[edited by - chacha on October 22, 2003 10:54:39 AM]

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
quote:
Original post by __fold
Is it always signed?

Don''t you mean unsigned ?

Share this post


Link to post
Share on other sites
quote:
Original post by xg0blin
size_t is defined in stdlib.h I believe, so just look in the file.


He means size_type in the vector type as was stated. However, size_t is defined in cstddef in the std namespace.

Share this post


Link to post
Share on other sites

  • Advertisement