STL1 [C++/STL] How to find the size, length of a vector In C++, there are several ways to calculate the size of a vector, which indicates how many items it contains. Although there isn’t a single definitive method, you can choose from the following summarized approaches. Keep in mind that there isn’t necessarily a right or wrong answer; consider these as reference points. 1. std::vector::size: This directly returns the size of the vector. For example.. 2024. 4. 21. 이전 1 다음