KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I just started learning C++ and have a question about vectors. The book I'm reading states that if I want to extract the size of a vector of type double (for example), I should do something like: vector<double>::size_type vector_size; vector_size = myVector.size(); Whereas in Java I might do int vector_size; vector_size = myVector.size(); My question is, why is there a type named vector::size_type? Why doesn't C++ just use int?
Tags (comma-separated)
Save Edits
Cancel