C++ vector

来自泡泡学习笔记
跳到导航 跳到搜索

遍历

std::vector<int> vec = {1, 2, 3, 4, 5};
for (size_t i = 0; i < vec.size(); ++i) {
    std::cout << vec[i] << std::endl;
}